Switchable templates and content placeholders - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Switchable templates and content placeholders

  • Switchable templates and content placeholders
  • We're finally in the midst of deploying a Sitefinity site. Due to some resource restrictions, we've decided to temporarily move forward with a Sitefinity implementation of our existing website template, and switch to a more modern design in the near future.

    I'm wondering how to build the two templates so that I can easily swap them in the back-end. Currently, if I lay out two templates in the back end, and try and change the template assigned to a page, content is left orphaned in the designer. I'm guessing this is because SF is generating different content placeholder IDs, so the designer and renderer aren't sure where to put the content.

    How can I overcome this problem?
  • Hello David,

    Thank you for contacting us.

    Changing page templates indeed results in some layout issues which can be fixed manually.
    When a template is changed, if the control does not have a specified placeholder on the new template, it will either be automatically placed on the first available content placeholder or appear as semi-transparent, indicating that it needs to be placed in a valid placeholder in order to be displayed on the front-end. Usually, a quick rearrange using drag & drop is needed to put everything back to where it belongs.
    What can further be indicated as a problem might be a mismatch in your CSS. One of the ways to avoid this is to give your layout element a CSS class for its wrapper. With this you can easily reuse existing rules in your stylesheet.
    Another thing that might be done is using set IDs for the ContentPlaceholders directly on the new Master Template. All pages that will get this template will have their elements automatically recognize the block where they should go when the template is changed.

    I hope this information helps. Wish you a great day.

    All the best,
    Ivaylo Angelov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items