Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
<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?
Offline
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' />
Offline
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).
Offline
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)
Offline
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.
Offline
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.
Offline
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
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.
Offline
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
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.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline