Expand my Community achievements bar.

SOLVED

Template that allows for future layout and design changes to previously created pages

Avatar

Level 1

We would like to build a model that allows us to create a large set of pages with a specific layout and design today but we will likely need to modify the layout and styles in the future and we want all previously created pages to be updated in one place rather than having to go back to every individual page.

 

For example, we would like to build a website that provides information about restaurants.  We would like to create a template for our restaurant detail pages.  Each page will contain a main nav bar, hero image, a title, some body copy that provides a lot of detail about the restaurant, and a component a component below it that contains a list other restaurants.

 

Our current thought is:

  1. We will need to build a template that contains components for all of the above elements.  Those components would be placed either in "Structure" or "Initial Layout".
  2. Authors will create a new page for each restaurant using the the "Create" button and choosing the template.
  3. Authors will replace "dummy" images and text with real information.

 

This process will likely be used dozens of times to build dozens of pages.

 

We are confident that we will need to change layout and change styles at some point in the future.  For example, we may decide to add a block of static "About Us" text between the body copy and the list of other restaurants and we may want to change the style of the title.  We will want all of our pages, including the ones that were previously created, to include this text and update the title style.  Since we will already have created dozens of pages, it would be best if we could do this at the template level and have that change apply to all previously created pages automatically.

 

What would be the best approach to solve for this scenario?

 

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @StephenLRouse ,

If you are not able to fulfil your use case, by just using the structure of the template, then you can explore couple of other options, which are:

 

Using Experience Fragments

You can include an experience fragment component in the template and later on you can keep on  changing the content in the experience fragment, and it will be reflected in old and new pages.

Couple of articles how Experience fragments work:

https://github.com/AdobeDocs/experience-manager-65.en/blob/main/help/sites-authoring/experience-frag...

https://medium.com/exadel-digital-marketing-technology-practice/aem-experience-fragments-templates-5...

 

Using Inheritance in AEM

You can have a parent page for all the restaurant details pages and whatever changes you do on this parent page, will be reflected on all the inherited child pages.Please go through this article for details

https://chintalapudi4.medium.com/inheritance-in-aem-editable-templates-5b61ea807368#:~:text=Problem,...

 

Hope this helps.

Thanks,

Chitra

 

 

         

 

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @StephenLRouse 

 

Here is how it works:

After the new page is created a dynamic connection is maintained between the page and the template; this means that changes to the template structure will be reflected on any pages created with that template (changes to the initial content will not be reflected).

 

As per your use case, you can make changes to the structure and expect them to be reflected in the old pages but not to the initial content.

 

Hope this helps!


Thanks,
Kiran Vedantam.

Avatar

Level 1

Thanks for your response.

You say "you can make changes to the structure and expect them to be reflected in the old pages but not to the initial content".  That has been my experience.

My hope is that there is a way for my changes to be reflected in both new and old pages.  I've worked in and built many platforms in the past where this is possible.  Those platforms separate data layer and design layer.  Pages are rendered dynamically by parsing the URL to determine which template and which data record to use.  The template is "consulted" on every request from the end user.  So, we can modify the template with the assurance that both new and old records will be displayed with any new layout and style changes.

In my limited experience with AEM, it seems that only content, components, styles, etc. defined in the "Structure" can be changed in both new and old pages but this content cannot be modified after page creation by the author.  Conversely, content, components, styles, etc. defined in the "Initial Content" can be changed by the author after page creation but changes to layout and styles will not be included in old pages.

AEM seems to be an extremely powerful platform so I hope this is possible and that someone with more experience than I might be able to share a solution.  Based on my reading, AEM supports a headless approach.  Would that be the right approach?

Avatar

Correct answer by
Community Advisor

Hi @StephenLRouse ,

If you are not able to fulfil your use case, by just using the structure of the template, then you can explore couple of other options, which are:

 

Using Experience Fragments

You can include an experience fragment component in the template and later on you can keep on  changing the content in the experience fragment, and it will be reflected in old and new pages.

Couple of articles how Experience fragments work:

https://github.com/AdobeDocs/experience-manager-65.en/blob/main/help/sites-authoring/experience-frag...

https://medium.com/exadel-digital-marketing-technology-practice/aem-experience-fragments-templates-5...

 

Using Inheritance in AEM

You can have a parent page for all the restaurant details pages and whatever changes you do on this parent page, will be reflected on all the inherited child pages.Please go through this article for details

https://chintalapudi4.medium.com/inheritance-in-aem-editable-templates-5b61ea807368#:~:text=Problem,...

 

Hope this helps.

Thanks,

Chitra