Requirements to swap templates that a page uses and retain existing content?

Jason S asked on April 23, 2014 13:19

Suppose a website using portal engine has three page templates:

Template 1 Template 2 Template 3

Each template has four zones:

Zone A Zone B Zone C Zone D

Within the three templates, Zones B, C, and D are named the same and all of the layout properties are identical. Also, Zones B-D contain the same types of web parts that also have the same web part name and ID, but each contains one repeater web part that is different. In Template 1, Zone A is a different layout and has different web parts than Templates 2 and 3.

When changing the template a page uses, content is not lost when switching Template 2 > 3 or Template 3 > 2; however, if switching from Template 2 > 1, Template 3 > 1, or Template 1 > 2 or Template 1 > 3, the content is lost in all zones & web parts.

Must the web parts AND layout code be identical between two templates in order to switch between them without losing any content?

Thanks!

Recent Answers


Brenden Kehren answered on April 23, 2014 13:51

You need to have a good understanding of how layouts, templates, pages and content work to really understand all of this but I'll try.

Switching templates a page utilizes will not affect the layout which holds the webpart zones. Templates need layouts and if your template is not using the same layout or a layout with the same webpart zone count and names, you'll have problems. Most sites don't need but a few layouts. The benefit of using shared layouts is if you need to make a large change, it makes it simple, vs. going to each page template and modifying its individual layout. So that would be the first thing I'd check, are you using shared layouts or not.

Here's an example for a shared layout scenario: if layout 1 contains 3 webpart zones and the are named Zone1, Zone2, Zone3 then you switch a template to use layout 2 that has 3 webpart zones as well but they are named Zone1, Zone2, ZoneA all the webparts in Zone3 will show in a gray space at the bottom of the page stating webpart zone Zone3 is not part of this layout/template. You can move the webparts to a different zone or remove them. No content will be displayed if the webparts are in this "invisible" webpart zone.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.