Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-10-23 13:02:02

belipe
Member
From: Köln
Registered: 2006-03-24
Posts: 27
Website

<txp:variable /> not parsed inside <txp:article_custom />

Hi beautiful community,

I don’t know whether it’s a bug, a feature or if I’m just not capable of figuring out the right solution.

<txp:article_custom form='marginal' id='<txp:variable name="marginal1" />' />

should throw a custom article with the id kept in variable1.
variable1 is available if I put it in the code without the surrounding code (I even swapped ‘ and “ already). I am now using asy_wondertag like in the good old times but I refuse to believe that this is the only solution. Any ideas?


<txp:nothing_else />

@belipe

Offline

#2 2012-10-23 13:23:34

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: <txp:variable /> not parsed inside <txp:article_custom />

Just for discarding any other issue, have you tried putting the ID value directly in article_custom to check if it works?
Like:

<txp:article_custom form='marginal' id='123' />

La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2012-10-23 13:33:13

belipe
Member
From: Köln
Registered: 2006-03-24
Posts: 27
Website

Re: <txp:variable /> not parsed inside <txp:article_custom />

I hadn’t done it but just tried and it works fine. Must be something else.

Just for the record I’m using aam_split_custom_field, asy_wondertag, cnk_versioning, rah_sitemap, rss_article_edit, rss_auto_excerpt, rvm_if_this_article and soo_if_frontpage with Textpattern 4.4.1 (didn’t want to update this one yet).


<txp:nothing_else />

@belipe

Offline

#4 2012-10-23 13:36:49

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: <txp:variable /> not parsed inside <txp:article_custom />

I wonder if it may be a white-space issue.
How are you creating the variable?

(BTW, I don’t think you will every need asy_wondertag, you could get rid of it)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2012-10-23 13:47:07

belipe
Member
From: Köln
Registered: 2006-03-24
Posts: 27
Website

Re: <txp:variable /> not parsed inside <txp:article_custom />

I’m also sure I wouldn’t need it but this was the last resort for now since I have to get this thing done by this afternoon :-)

I just define the variable like

<txp:variable name="marginal1" value="<txp:aam_scf name='artikelnummern-marginalspalte' delimiter='|' offset='0' limit='1' />" />

and the variables are defined like 23|42|34 in a custom field. Maybe you are right but I will check this tomorrow or so since time is running a little bit.


<txp:nothing_else />

@belipe

Offline

#6 2012-10-23 13:56:31

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: <txp:variable /> not parsed inside <txp:article_custom />

I notice that you are using double quotes around a txp-tag-as-value in the code you posted above. That shouldn’t work…
It should be:

<txp:variable name="marginal1" value='<txp:aam_scf name="artikelnummern-marginalspalte" delimiter="|" offset="0" limit="1" />' />

You already stated that a simple <txp:variable name="marginal1" /> prints the variable correctly (as per the double quotes you used in your snippet, it shouldn’t…).
But, well, try the single quotes version to see if it makes a difference.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#7 2012-10-23 14:16:47

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

Re: <txp:variable /> not parsed inside <txp:article_custom />

The code at the top has some problems too. It should be: <txp:article_custom form="marginal" id='<txp:variable name="marginal1" />' />


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

Offline

#8 2012-10-23 14:22:40

belipe
Member
From: Köln
Registered: 2006-03-24
Posts: 27
Website

Re: <txp:variable /> not parsed inside <txp:article_custom />

Thanks for your input. I’ll come back to this after the deadline.

But just to be sure: Do you really have to use single quotes on the outside and double quotes on the (additional) inside? I didn’t know this yet and it always worked fine.


<txp:nothing_else />

@belipe

Offline

#9 2012-10-23 17:59:06

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

Re: <txp:variable /> not parsed inside <txp:article_custom />

Hi Philipp

Yes/no… This will introduce you to the joys of the tag parser. It might be confusing at first but you get used to it.


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

Offline

#10 2012-10-23 21:18:25

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

Re: <txp:variable /> not parsed inside <txp:article_custom />

I didn’t think you ever HAD to use DOUBLE Quotes. You do need to use SINGLE quotes for tag-in-tag stuff.


My Plugins

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

Offline

Board footer

Powered by FluxBB