Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-04-07 00:16:17

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Compare the value of two txp variables

I thought this would work

<txp:if_variable name="year" value="<txp:variable name="cyear" />">

but I keep getting

Tag error: <txp:if_variable> ->  Textpattern Notice: variable_name_empty  on line 4524

I thought I could find the answer looking around but I am coming up empty.

Offline

#2 2011-04-07 00:17:30

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Compare the value of two txp variables

Tags in Tags requires single quotes. Could that be the problem?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#3 2011-04-07 03:52:07

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: Compare the value of two txp variables

It always does help to actually read the directions.

And after a little bit more experimentation, I was able to reduce it down to one variable and one tag:

<txp:if_variable name="archiveyear" value='<txp:posted format="%y" />'>

Thanks.

Offline

Board footer

Powered by FluxBB