Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-08-22 05:15:37

Sunfoot
Member
From: Felanitx
Registered: 2009-02-07
Posts: 16
Website

[SOLVED] Simple variable question

Hi everybody!

I am curious why the code 1 and 2 below, set in an article list context with a published date in the future, output different values

1. 
<txp:variable name="catalan_month"  value="<txp:posted format='%b' / >" />
<txp:variable name="catalan_month" /> 
2. 
<txp:posted format='%b' /> 

2. is correct.
1. outputs the actual month.

Why this?

Offline

#2 2016-08-22 05:28:36

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: [SOLVED] Simple variable question

Sunfoot wrote #300730:

Hi everybody!

I am curious why the code 1 and 2 below, set in an article list context with a published date in the future, output different values

1....

2....

2. is correct.
1. outputs the actual month.

Why this?

It should be

<txp:variable name="catalan_month" value='<txp:posted format="%b" />' />

Note the use of quotes.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2016-08-22 07:04:02

Sunfoot
Member
From: Felanitx
Registered: 2009-02-07
Posts: 16
Website

Re: [SOLVED] Simple variable question

Kalimera, Yannis!

Thanks!

I need glasses :-)

Felix

Offline

#4 2016-08-22 07:42:19

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: [SOLVED] Simple variable question

Sunfoot wrote #300732:

Kalimera, Yannis!

Thanks!

I need glasses :-)

Felix

Hi Felex, is the problem solved?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2016-08-22 11:13:56

Sunfoot
Member
From: Felanitx
Registered: 2009-02-07
Posts: 16
Website

Re: [SOLVED] Simple variable question

Hi Yiannis

Yes, it is. Thanks to your help.
It was just an “orthographical” problem, as you mentioned.

Felix

Offline

#6 2016-08-22 16:30:15

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [SOLVED] Simple variable question

Just an fyi for those allergic to single quotes. This also works…

<txp:variable name="catalan_month"><txp:posted format="%b" / ></txp:variable>

Offline

Board footer

Powered by FluxBB