Add multiple layouts (One column, two column etc.) presentation on single data template


Here is a small tip for you who is working on multiple layouts (one column, two column etc.) website based on Sitecore.

Some time our requirement is like our website has multiple layouts (one column, two column etc.), and we have to create layout specific generic pages like (one column generic page, two column generic page etc.). So in this case generally what we do we creates layout specific data templates (one column generic data template, two column generic data template etc.), also we know field will remain same for all data templates.

So, what I did to achieve this requirement and avoid to create multiple data templates with same fields.

Step 1 – I have created a generic data template and created multiple branch template by referring this generic data template for each type of layout (one column generic page, two column generic page etc.).

Step 2 – After that I set presentation as per our layout on branch template instead of generic data template. And created items with branch templates as per our need.

With this approach we can avoid to create multiple data templates with same fields.

Please see below screenshot.
Presentation

 

If some one have some other idea please share in comment below.

 

Until next time, have a Sitecoretastic day!

 

Advertisements
This entry was posted in Sitecore and tagged , , , , , , . Bookmark the permalink.

4 Responses to Add multiple layouts (One column, two column etc.) presentation on single data template

  1. Sean says:

    This doesn’t seem to be working for me. When I update the presentation of the branch template and create a new item based on that branch, it takes the standard values presentation of the template rather than the changes I made to the Branch template item presentation. Any thoughts? Did you run into this as well?

    • Yogesh says:

      Hello Sean,
      Yes, I have implemented same thing in one of my project,and this solutions was working fine there. Can you please tell me which version of Sitecore you are using.

      -Regards,
      Yogesh

    • Yogesh says:

      Hello Sean
      I have tested with Sitecore 7.2 version and it’s working fine for me, I have also attached a screenshot with this post to show where we need to update presentation.

      Please let me know if it’s not working for you.

      -Regards,
      Yogesh

      • Sean says:

        Yogesh,

        Thank you for your response!

        I’m using Sitecore version 7.2 (initial release). After digging into this further I discovered something odd. When I repeated the same steps using a different data template, (in this case I used the Sample Item that came pre-installed with Sitecore) I achieved what I wanted to. This issue that I am seeing only manifests itself with the data template I created (which inherits from a base template, which inherits from the standard template). Here are the steps I took to try and fix it to no avail.

        1. Reset branch template to standard values and update the presentation.
        2. Delete the branch template and re-create it.
        3. Delete and re-add data template standard values item.

        If you have thoughts on this I appreciate any input you have.

        Thanks,
        -Sean

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s