Forum
Blog SectionID
I have a blog with three sections: let's call them: Section1, Section2, Section3
I'd like to add some html code to the top of each post page depending on whether the post a visitor is viewing is from Section1, Section2 or Section3..
I was hoping to use:
<perch:if exists="sectionID" value="Section1">
<p>Section1 content goes here</p>
</perch:if>
<perch:if exists="sectionID" value="Section2">
<p>Section2 content goes here</p>
</perch:if>
<perch:if exists="sectionID" value="Section2">
<p>Section3 content goes here</p>
</perch:if>
When I try that I get all three "Sectionx content goes here" messages and not just the one that perch:if should be displaying. In fact, it doesn't seem to matter what I have entered for value, all three messages get output.
Thanks!
exists
doesn't usevalue
- I think you wantid
.But also if that's our
sectionID
variable, it will always be an integer.Thanks Drew.