Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

how to inherit base template to another template.

Avatar

Level 3

Suppose i have two templates 'HomePage' & 'SectionPage'. Now in these templates i want to inherit my base template and this base template  refers to a base component containing iparsys. My requirement is i want to drag header component in iparsys of the base template page and these changes in base template should reflect in  'HomePage' & 'SectionPage' templates.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Thats the basic and normal template design we should do..

Create a 'base template' using 'base page component' inheriting the libs sightly page component.Override all the htmls like header.htlm, footer.html, body.html etc which you would like to override.

Now, once you have defined your base page component. create homepage and section page component with the resourceType of base page. Automatically all the htmls from the base page component would be available. Now dont override header.html in your case and override only body.html or content.html in the homepage and sectionpage.

Hope I am clear !

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Thats the basic and normal template design we should do..

Create a 'base template' using 'base page component' inheriting the libs sightly page component.Override all the htmls like header.htlm, footer.html, body.html etc which you would like to override.

Now, once you have defined your base page component. create homepage and section page component with the resourceType of base page. Automatically all the htmls from the base page component would be available. Now dont override header.html in your case and override only body.html or content.html in the homepage and sectionpage.

Hope I am clear !

Avatar

Level 10

It sounds like you want to have a named iparsys on the homepage, and then an iparsys w the same name on the sub-pages (section pages), and the iparsys will inherit down the tree. (section pages will show whats in the homepage) –this is simply how the iparsys works, and you doesn’t have to do anything special. The original geometrixx sidebar follows this paradigm.

Avatar

Level 3

what i inferred from you , that i tried but when i drag image component in page referring to base template , it is not reflecting in page of homepage template and section page template.