Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-08-04 01:34:46

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

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

#2 2011-08-04 03:55:59

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

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

Board footer

Powered by FluxBB