开发者

Sitecore - Overriden presentation placeholder changes sitewide?

开发者 https://www.devze.com 2023-02-20 17:34 出处:网络
How can I make renderings/sublayouts that are added to a placeholder by the user on one page be displayed sitewide?

How can I make renderings/sublayouts that are added to a placeholder by the user on one page be displayed sitewide?

I have 4 placeholders in the footer of the site. In these placeholder, a user needs to be able to add / remove modules (in the forms of sublayouts) and these changes want to happen site wide. When they do this with the Page Editor, it overrides the presentation being set by the template开发者_如何学运维 standard values. At the moment, for example the user removes a sublayout from the homepage it works on that item but all the other pages in the site under that retain the standard values.

I suspect I may need to alter how my presentation layout is being assigned. Its as if I want to make a placeholder in a sublayout 'shared' but I can't figure this out...


If this is something you want to assign site-wide and ONLY site-wide, then perhaps you should change how to do the assignment. One approach is to have a global section in your tree, let's call it Global Settings (/sitecore/content/global settings). In here, have a section for footer modules and a droplink for each of the 4 spots (i.e. 4 droplink fields, one for each of the spots). Then assign a module item to each spot -- each module would then need to be an item in the tree. In the code for your footer just use the sublayout renderer to display the appropriate module: <sc:sublayout path="path to ascx" runat="server" /> -- four times of course for each of the four.

Unfortunately this goes around the normal presentation settings of a Sitecore item and puts the presentational stuff into the fields of the template. If you can provide more details on each module then I can probably help a bit more. For example, do your sublayouts make use of the DataSource field or are they hard-coded to look at specific data?


Have you examined how you can handle with a Conditional Rendering Rule? For a specific condition --- field value, ancestor item, data template, etc, - use an action to override the Data Source. In this manner, all the sub items would inherit the DataSource item.

0

精彩评论

暂无评论...
验证码 换一张
取 消