Search code examples
sitecoresitecore-mvc

Sitecore Change Page Layout with renderings


I've two layouts for the website, one for public (default) and other for private area, that I created.

When I create a new page (it uses the Public Layoyt by default) and if I want it to be with private layout I need to change in the Presentation > Details.
The problem comes after, I have default renderings in the Private Layout that aren't inserted on it.

So, my questions are:

  • Is there any possibility to ask the user when he creates a new page to ask for the layout?
  • Is possible for the Default Renderings in Private Layout to come together when changing the layout?
  • Am I doing right with having two layouts in the same instance of sitecore?

Thanks in advance!


Solution

  • One more alternative would be to create 2 branch templates

    • Public Page
    • Private Page

    Works similar to how you would do it from 2 separate page templates, but removes the need for having templates that are there purely for presentation.

    Then set your default presentation for each type of page on the branch template item. You can also set things like security options etc... just like you might with the standard values of a page template.

    As an advantage over page templates, you can also create a child structure if needed - so if you had a /assets folder that you needed for each page type, a branch template is great for that.