Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
if_variable not matching
My if_variable conditions don’t seem to be working, they never match the value properly. The textpattern tracing indicates it always evaluates false!
<txp:variable name="page_url" value="<txp:page_url/>"/>
<txp:if_variable name="page_url" value="/products/"/>
<!-- this is never emitted -->
</txp:if_variable>
I have confirmed that page_url has the value: /products/ because emitting the variable to the output html.
Offline
Re: if_variable not matching
Hi Mark,
when nesting txp tags, use single quotes:
<txp:variable name="page_url" value='<txp:page_url/>' />
BTW, you have also txp:if_section
for testing sections.
Offline
Re: if_variable not matching
Aha! Thanks very much for the single quotes guidance.
Using txp:if_section
won’t work for me because I’m not just testing for a section, I’m trying to test for a section home. There is another thread on this topic
maniqui wrote:
Hi Mark,
when nesting txp tags, use single quotes:
<txp:variable name="page_url" value='<txp:page_url/>' />
BTW, you have also txp:if_section
for testing sections.
Offline
Pages: 1