Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
help with variables
i’d like to use this in an article form… it doesn’t seem to work right, though – always acts as though the variable is matches, even when I know it doesn’t.
<txp:variable name='<txp:title />' value='<txp:php> echo safe_strftime("lj"); </txp:php>' />
<txp:if_variable name='<txp:title />' value='<txp:atb_tw_created_at format="lj" />'>
article content...
</txp:if_variable>
i used the title as the variable name because i want to have multiple articles display on the page, and assume naming the variable something static would cause problems with multiple articles.
thanks for your help!
Offline
Re: help with variables
Hi
I am not sur but maybe using <txp:title /> can have problem! have you tried to use a static variable name for testing to see if the code works! if it does then the probem is the txp:article if it doesnt then the problem is else where!
You can use the url of article instead of txp:article because it s sanitised (ex: title: “My Name” become “my-name”)
Cheers
Offline
#3 2011-08-04 19:55:23
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: help with variables
If Dragondz’s tip doesn’t fix it, can you post a tag trace of a page where it doesn’t work as expected? And please mention what you would have expected there?
Offline
Pages: 1