Shailesh
Shailesh

Reputation: 544

Sitecore 8.1 Header and Footer Composite Component

In Sitecore I have created base Template & Renderings for "Header, Top Menu, Logo, Search ,Login Button…etc that comes in Header across all Pages of the Site."

Also the same template & Rendering is using in other website so we can't set value in Standard field.

Now the problem is “suppose we have 100 pages in a Site then each page we have to go and add/update rendering & data source.

Is there any way that a “Header rendering” contains child rendering and by placing “Header rendering” render all its child renderings.

Header Composite Component ===>

Upvotes: 2

Views: 2037

Answers (3)

jammykam
jammykam

Reputation: 16990

You may want to take a look at using Placeholder Fallback.

This will allow you to add components and renderings to a top level page and then the child pages would "fallback" to using the renderings inserted into the placeholder of the top level page in the item hierarchy. The editors can also insert page specific renderings on each child page if required.

If you do not want to custom code and only out of the box features then you could use Devices. You can find more information in the documentation about Set up a device layout. Once the device is created you can specify a different default device per site:

Now when you open the Presentation Details on the __Standard Values of your templates you can specify a different Layout or Renderings per device, i.e. different ones for AltSiteDevice

Upvotes: 1

Richard Seal
Richard Seal

Reputation: 4266

There is a composite component module on the Sitecore Marketplace :https://marketplace.sitecore.net/Modules/C/Composite_components.aspx?sc_lang=en

This fill's your requirements exactly.

It works by creating a "Composite Component" item, then you add your renderings for your header to that component. E.g. Logo, Navigation etc...

Then in the standard values of your page templates, you add a new Composite Component rendering and set the datasource to the component item you created.

The module will then inject the renderings from the component item presentation into your current item. So you only have to update a single place to update all pages etc...

I have this running in a few production sites and it works well. It even supports the Experience Editor.

Upvotes: 1

RvanDalen
RvanDalen

Reputation: 1155

I don't think there's a solution out of the box. SxA solves this with Partial and Page Designs at site level. Just wrote a blog about it:
http://reinoudvandalen.nl/blog/sitecore-experience-accelerator-partial-designs-and-page-designs/

I also made something that might help you: Partial Layout Presets http://reinoudvandalen.nl/blog/sitecore-partial-layout-presets/
It even allows you to store presets per site, but keep in mind that it injects composed layouts. If you modify the preset then it does not get applied to the pages where it was injected (though you might be able to pull something of with a shared datasource per site).

Lastly the obvious solution would be to create a page template per site so you'll be able to have standard values per site.

Upvotes: 1

Related Questions