Creating custom WebPartZone inside a webpart - sharepoint

i have one Webpart which shows an image slider. The image slider will be added by getting image url from webpart toolpart . and i will bind image slider in webpart using this.controls.add() method.
Here i need to allow users to add any webpart inside my webpart by creating a webpartzone. I think it is possible.
But the problem is everytime i'll create my control and webpartzone dynamically in creatchildcontrols() method. So if the user refresh the page the webparts inside the custom webpartzone 'll be deleted. Because i am building everying dynamically.
How to persist all the webparts and webpart proprties inside my custom WebPartZone, when the page refresh.
Please someone help me.

Why do you need to add zone? You can simply use ImportWebPart and directly add the control to your controls collection.
Regarding persisting the settings, the parent web part will have to do that for the children. For this to work, you can implement an interface on your child webpart, which the parent can call to get the settings. The settings can be serialized by parent webpart and stored in its personalization database.

Related

Creating A Custom Page in SAP Hybris

I am trying to create a unique page.
In general, i create a page template , from that template i create a page(in this case it is content page)
then i create content slot with a component within it and create a content slot name for its position at template or page,
afterwards i relate this slot with template or page.
But this time i am working on a different scenario,
What i am trying to do is making the management of this page much more easier.
The customer will create a bundle promotion page on backoffice but creating process contains too much steps on different locations.
I want to gather all these parameters to the page's administration panel.
For example content page's panel have some attributes but i am using my own component's attributes to fill the content slot.
Content Page Type's attributes : https://imgur.com/hGFMOnT .
I want to make a custom cms page type which will appear after pressing the plus sign,
for example Bundle Promotion Page (similar to content page).
creating page menu : https://imgur.com/4x5yfqO .
selecting page type : https://imgur.com/S3sm4Ay .
It must have a default template, content slot name, content slot with custom component in it.
All these parameters should be manageable from Bundle Promotion Page's administration panel.
Is this kind of concept possible with Hybris Backoffice?
Yes, it is possible.
please check this option in latest Hybris under WCMS menu in backoffice.There are default page types like email,document etc available as acceleratorservice extension. Custom page types can be created by including any custom attributes and content types.

Create a web page in Orchard

I need to create a "custom" web page in Orchard. As I understand it, below are the steps I need to take to do so. Before I go down this somewhat lengthy process, are there any steps I'm missing or that I can skip?
Create a model
Create a content part and content part record which use the above model
Create a driver which implements the Display method which returns the "shape" of the content part
Create a shape template to render the shape returned from the above driver
Create a content type which holds the content part
Create a page which holds the content type
Add the page to my site
This page is "custom", in the sense that it needs to pull data from a web service and display it in an interactive way. When the user makes changes, those changes will need to be sent back to the web service.
Those are really steps for creating a content item. You would want to create a content item if your page should be treated as content - e.g. administrators can create, edit, publish, unpublish, and finally delete your page.
If you just want to create a simple page, then there is nothing to stop you from creating your own ASP MVC controller. You can define routes for it using Orchard's routing, and if you decorate it with a [Themed] attribute, it will even inherit the site's theme.

Email view that does not show buttons and views of other activities

I want to add Emails to navigation so It can be used like any other entity. Editing sitemap is not a problem but it does not work in the expected way.
First, of all it shows all entities, not emails only. And consequently there are filters for other activities which are unwanted.
How do I make email-view that does not show other activities?
Create a new view in CRM showing the records you wish to see
Create a HTML web resource, with an iFrame pointing to the URL of the view you just created. It will look something like this /advancedfind/advfind.aspx?AutoRun=true&QueryId=%7b495B7974-58AC-E234-92D4-EE155D107003%7d&ViewType=4230&etn=email
Point your sitemap to the new web resource

How to use custom WrkTaskIp.aspx page in custom sharepoint workflow?

I have created as custom task edit browser enabled Infopath form which successfully gets open when user clicks on Edit task. But by default it opens up in the WrkTaskIP.aspx page which is available in 12 hive..Layouts folder.
Now the default WrkTaskIP form provides two following options as hyperlinks
1. Delete item, and
2. A link to navigate to the task display form
I want to customize the OOB, WrkTaskIP page and associate that with my workflow.
How exactly can i achieve this ?
Thanks.
Assuming you've got a custom task content type you can create a custom feature with an application page and make the task open the form in this page instead.
Copy the WkrTaskIP.aspx page from the 12 hive, modify the contents as you require and deploy this as an application page.
Then in your taskcontenttype.xml file point to your custom page by setting the Display or Edit values to the deployed location of your custom page:
<FormUrls...>
<Display>_layouts/YourCompany/Workflow/YourWrkTaskIIP.aspx</Display>
<Edit>_layouts/YourCompany/Workflow/YourWrkTaskIIP.aspx</Edit>
</FormUrls>

Sharepoint 2010 WebPart: Users in Site Members Group can't save property of web part

I've created some custom property for my web part with Personalizable(PersonalizationScope.User) attribute. I changing this property in EditorPartClass in ApplyChanges() Method only. The main problem is user with contribute permission for a site can't save this property when editing personalized view of a page. Changing property applies when user click OK button on EditorPart, but after page postback value returns to its previous condition. Users with full control privilleges saves this property without a problem.
If User has an "Add and Customize Page" privilege property saves too.. But than User can modify web part in shared view too.. It's bad...
you need to explicitly change the SafeAgainstScript attribute on the SafeControl tags. This is new in 2010 because of the Client OM. you can't ever be sure that the user won't type malicious JS - so make sure you also encode any input your property takes!

Resources