Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Another "Article tags cannot be used outside an article context"
I am sorry, I took a look at previous posts about it but I didn’t find an answer that fits my case.
I have this code in a page:
<txp:output_form form="bs_bundles_bar" />
That calls this code:
<txp:if_custom_field name="bundles_bar" value="visible">
<div id="bar" class="container_12 box">
<div id="bar_divisions">
<div id="bundles" class="">
<h3>Get a bundle and save</h3>
<txp:article_custom section="store" category="bundles" form="bs_bundles_bar_items" wraptag="ul" sort="position asc"/>
</div>
</div>
</div><!-- #bar -->
</txp:if_custom_field>
and I get the infamous error.
Error:
Tag error: <txp:if_custom_field name="bundles_bar" value="visible"> -> Textpattern Notice: Article tags cannot be used outside an article context on line 2291
Tag trace:
<txp:output_form form="bs_bundles_bar" />
[SQL (0.00025606155395508): select Form from txp_form where name='bs_bundles_bar']
[Form: bs_bundles_bar]
<txp:if_custom_field name="bundles_bar" value="visible">
Tag error: <txp:if_custom_field name="bundles_bar" value="visible"> -> Textpattern Notice: Article tags cannot be used outside an article context on line 2291
[<txp:if_custom_field name="bundles_bar" value="visible">: false]
</txp:if_custom_field>
Thanks, as always.
Offline
Re: Another "Article tags cannot be used outside an article context"
what’s in your form “bs_bundles_bar_items”?
Offline
Re: Another "Article tags cannot be used outside an article context"
Did you try?
<txp:article>
<txp:if_custom_field name="bundles_bar" value="visible">
<div id="bar" class="container_12 box">
<div id="bar_divisions">
<div id="bundles" class="">
<h3>Get a bundle and save</h3>
<txp:article_custom section="store" category="bundles" form="bs_bundles_bar_items" wraptag="ul" sort="position asc"/>
</div>
</div>
</div><!-- #bar -->
</txp:if_custom_field>
</txp:article>
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: Another "Article tags cannot be used outside an article context"
It’s an article form and its content is:
<li class="grid_4">
<h4><txp:title /></h4>
<txp:article_image wraptag="p" class="bundle-icon" />
<p class="bundle-description"><txp:body /></p>
<p class="bundle-price bundleButton">$<txp:aam_scf name="price, link" limit="-1" delimiter="|"/> <acronym title="United States Dollar"><span class="caps">USD</span></acronym> <a href="<txp:aam_scf name="price, link" offset="1" delimiter="|" />" title="add the bundle to cart">Add to cart</a></p>
</li>
I need to point out that the custom field “bundles_bar” is done thanks to the use of glz_custom_fields plugin.
Offline
Re: Another "Article tags cannot be used outside an article context"
colak wrote:
Did you try?
…
Just tried, but it doesn’t trigger the custom field though. :(
Offline
Re: Another "Article tags cannot be used outside an article context"
i take it that the custom field has no ‘real content except the ‘article_custom’ tag right? If all is working except the error. It’ll be OK once you switch to live mode
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: Another "Article tags cannot be used outside an article context"
caruso_g wrote:
<txp:aam_scf name=“price, link” offset=“1” delimiter=”|” />”
caruso_g wrote:
it doesn’t trigger the custom field though.
Logitech’s website shows <txp:aam_split_custom_field /> for the main tag. It’s only shows it being shortended to aam_scf for the conditional tag (<txp:aam_if_scf >). Could that have something to do with it?
Last edited by maverick (2011-03-14 19:31:46)
Offline
#8 2011-03-14 22:04:48
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Another "Article tags cannot be used outside an article context"
if_custom_field only works in an article context. So you need to change
<txp:output_form form="bs_bundles_bar" />
to
<txp:article form="bs_bundles_bar" />
(or article_custom)
If Yiannis’ example (using the txp:article tag) didn’t display anything, it probably means that there are no articles with that custom_field value in the context (section, category) you are currently viewing.
You could also try this:
<txp:article_custom bundles_bar="visible" form="bs_bundles_bar" />
Offline
#9 2011-03-14 23:40:11
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: Another "Article tags cannot be used outside an article context"
If you have txp:body
within <p></p>
, you will have paragraph within paragraph.
It’s better if you change your code <p class="bundle-description"><txp:body /></p>
.
Offline