Forum
How to do page conditionals in a header (global layout)
I've looked through the conditionals docs but my code doesn't seem to be working. I am trying to add a conditional statement to my global header so that I can display something if it is the homepage else, do something different.
Below is what I tried but I don't think it is correct as it is a global value, not inside a smaller template. I can't find the correct answer in the docs or the new forum.
<perch:if id="pageID" match="eq" value="1">
####
<perch:else>
###
</perch:if>
Where's
pageID
coming from? Is it a layout attribute?No I wasn't passing it in as a layout variable, I thought it would be globally available from the queries that are run for the page content?
It's not globally available.
Why not use a layout variable to indicate the home page?
Andrew, I hope this helps. Along the lines of what Drew is suggesting.
example.php
global.header.php
Robert