I have over 100 pages created with a single template in AEM. The header for these pages is authored using an Experience Fragment, which is then included in the template's structure.
I need to create a slight variation of the header for 10 out of these 100 pages without affecting the other 90 pages. Since the Experience Fragment is part of the template's structure, changing it there would impact all pages.
How can I achieve this variation for just the 10 specific pages? What is the best approach to implement this in AEM?
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @pranayr
A slight variation of the header for specific pages without affecting the other pages in AEM
approach:1
1. Create a new template: Create a new template specifically for the 10 pages that require the variation in the header. This template will be a copy of the original template but with the necessary modifications.
2. Modify the header component: In the new template, modify the header component to include the desired variation. You can either create a new variation of the header component or add additional logic to the existing header component to handle the variation.
3. Apply the new template: Apply the new template to the 10 specific pages that require the variation in the header. This can be done by changing the template assignment for each page individually.
4. Update the original template: In the original template, remove the inclusion of the Experience Fragment for the header. This will ensure that the original template does not impact the 10 pages with the variation.
approach:2
you want to keep the original template and header component intact
1. Create a new component: Create a new component specifically for the variation in the header. This component will be similar to the header component but with the necessary modifications.
2. Include the new component: In the 10 specific pages that require the variation, include the new component instead of the original header component. This can be done by adding the new component to the page structure or by using a component placeholder.
3. Configure the new component: Configure the new component to display the desired variation in the header. This can be done by adding additional logic or customization specific to the 10 pages.
By using a separate component for the variation and including it only in the specific pages.
hi @pranayr ,
Below are the 2 options which you can try considering
Option 1
Pros
Cons
Option 2
Note: If the ask is to update in production. Please try validating this once in local or lower instances before implementing any of the above approaches
Hi,
It depends on several factors about the nature of this change to determine the best approach. Are these changes permanent? Are you open to code development and deployment, or is it solely author work? Is this something that will occur in the future as well, or is it a one-time thing?, etc. So, in addition to @Anil_Chennapragada's options, I also would consider:
Hope this helps
Hi @pranayr
A slight variation of the header for specific pages without affecting the other pages in AEM
approach:1
1. Create a new template: Create a new template specifically for the 10 pages that require the variation in the header. This template will be a copy of the original template but with the necessary modifications.
2. Modify the header component: In the new template, modify the header component to include the desired variation. You can either create a new variation of the header component or add additional logic to the existing header component to handle the variation.
3. Apply the new template: Apply the new template to the 10 specific pages that require the variation in the header. This can be done by changing the template assignment for each page individually.
4. Update the original template: In the original template, remove the inclusion of the Experience Fragment for the header. This will ensure that the original template does not impact the 10 pages with the variation.
approach:2
you want to keep the original template and header component intact
1. Create a new component: Create a new component specifically for the variation in the header. This component will be similar to the header component but with the necessary modifications.
2. Include the new component: In the 10 specific pages that require the variation, include the new component instead of the original header component. This can be done by adding the new component to the page structure or by using a component placeholder.
3. Configure the new component: Configure the new component to display the desired variation in the header. This can be done by adding additional logic or customization specific to the 10 pages.
By using a separate component for the variation and including it only in the specific pages.
Views
Likes
Replies
Views
Likes
Replies