Let's see how you can hide the news summary on the Contact Us page.
1. Open the Contact Us page (Content | Pages) for editing.
2. Switch to the Options tab, and enter nonews into the field Extra Page Attribute 1.
3. Save the page.
4. Now in the admin console, open your main template (Layout | Templates).
5. Find the Smarty tag
{news}
, and add anIF
function as shown:{if $node->extra1 != "nonews"} {news ...} {/if}
6. Check the Contact Us page to see the changes.
Extra page attributes are a simple way to give additional control over the layout of the website to the editor of the website. He should only know what he must enter into the field Extra Page Attribute 1. In the template, you evaluate whether any value is saved in the field and control what content should be shown or not on this specific page.
The values entered in the extra page attributes can be retrieved in the template with $node->extra1, $node->extra2
, and ...