This feature helps you load a custom template for a particular section page.
- An administrator first needs to create a section in the dashboard (Ex: Social Wall).
- Inside engine/dynamic_content/ create a new section file named section_section-name-here.xml (Ex: section_social-wall.xml).
- Copy the contents of subpage.xml inside your new template and hack away!
- Your new custom template will be available on /social-wall url.
Advanced
When most of the template is the same as the original subpage.xml, you should consider making use of the <block> XML tag. This will allow you to make use of inheritance and keep your code cleaner and modular.
Start by creating a block inside your original subpage.xml file:
<block name="body"> <!-- Code placed here will be available on all subpages --> <!-- Create a new placeholder block you want to use --> <block name="custom_block_name"> <!-- Code placed here will be overwritten with code in section_section-name-here.xml --> </block> <!-- Code placed here will be available on all subpages --></block>
Then in your new template section_section-name-here.xml add this code:
<import_xml path="subpage.xml"> <!-- Inherit subpage.xml markup --> <!-- This will override the same block in subpage.xml --> <block name="custom_block_name"> <div> <!-- Code placed here will be available only on section_section-name-here.xml --> </div> </block></import_xml>
Note: You can use any name for your blocks tag, just change name="custom_block_name" to your liking. Make sure you use the same block name across all your section templates.