Exceptions for Particular Page
As part of Best Practices, use as few foundation/Master Pages as possible for a project.
For one particular site, I was delighted to see all the pages looked like they could be accommodated by one single template. Except one page. This index page did not display the headline of the page, where all the other subpages did. The absence of this one element meant I needed to change my entire template structure, or build a new template just for the index page.
Ha - Noway!
Instead I made a template exception using render tags and the page GUID.
<reddot:cms>
<if>
<query valuea="Guid:<%info_pageGuid%>" operator="==" valueb="Guid:27EBF76820A042B08C64C86FD72CDA2F">
<htmltext>
</htmltext>
</query>
<query type="else">
<htmltext>
<h1><%hdl_title%></h1>
</htmltext>
</query>
</if>
</reddot:cms>
I created an info placeholder "GUID of Page" to pull the page GUID to valuea. Then I compare it to the GUID of the index page. I found the GUID of the index page by looking under "Page Information" in SmartEdit. GUIDs (Gloabl Unique Identifier) are assigned to pages, elements, and content classes. RQL uses GUIDs to handle passing commands through the API. In this case, I am assigning the index page's GUID to valueb and comparing valuea to valueb.
If valuea equals valueb then write nothing:
<htmltext></htmltext>
Else write headline
<htmltext>
<h1><%hdl_title%></h1>
</htmltext>
No comments below.
Add your thoughts