Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-10-26 13:46:38
- ajw-art
- Member
- Registered: 2010-02-10
- Posts: 33
Tag can't be used outside article context when in article form
I’m working on a portfolio site and would like to use <txp:article /> to display each work and information about it. I accomplished this smoothly on another site thanks to help from the forums, but I’ve hit a snag in attempting to replicate it on my current project, and I’m not sure why.
TXP is telling me that article tags— title, body, etc— can’t be used outside an article context. BUT, all of said tags are contained within an article form and are being output via <txp:article>. It’s entirely possible I’m missing something obvious, but I’ve poked and prodded at everything I could think of and no dice. <txp:article> seems to render as far as the <txp:rss_suparchive /> tag then klunk out.
<section id="content" class="equal">
<txp:article_image class="portfolio" />
<aside id="thumbnails">
<div class="slides">
<txp:rss_suparchive section='<txp:section />' form="galnav" />
</div>
<a href="#" class="prev" id="prev" title="Previous Set of Works">△</a>
<a href="#" class="next" id="next" title="Next Set of Works">▽</a>
</aside>
</section><!--end content-->
<aside class="equal">
<h1><txp:title /></h1>
<txp:body />
<txp:if_custom_field name="sitelink">
<a href='<txp:custom_field name="sitelink"/>' title='<txp:title />' class="contact">Visit Site</a>
</txp:if_custom_field>
</aside><!--end sidebar-->
And the code that’s calling it
<txp:output_form form="head" />
<txp:article limit="1" form="portfolio" /> <!--begin article-->
<txp:output_form form="foot"/>
Lastly, the live page for reference (and the tag trace)
Offline
Re: Tag can't be used outside article context when in article form
Here are my notes for the draft of my answer. Maybe those thoughts lead somewhere.
Draft
I am not sure why you are using
<txp:rss_suparchive section='<txp:section />' form="galnav" />
- Side note: rss_suparchive is ORPANED. Don’t expect support from author Rob Sable.
- Main point: I am not sure if txp:rss_suparchive can be used in single article context. (I only use it on specific archive pages.)
Questions
- Where do all those Notice: Undefined variable: uXXXXX … come from?
- Maybe txp:rss_suparchive has a problem with article data (expiration?)
- Q: Did you test a hardcoded
section="section"
? What’s inform="galnav"
? (see below)- Does it work if you delete the whole
<div class="slides">
block?
That’s the debugging output I see for form="galnav"
:
<txp:if_different>
[<txp:if_different>: true]
<txp:posted />
<txp:permlink>
<txp:article_image thumbnail="1" class="thumb"/>
[SQL (5.98430633545E-5): select * from txp_image where id = 15]
</txp:permlink>
</txp:if_different>
I am sure the better solution is to use (read: go that way and add your attributes)
<txp:article_custom section='<txp:section />' form="galnav" />
Last edited by merz1 (2010-10-26 15:28:19)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
Re: Tag can't be used outside article context when in article form
I suspect the problem is caused by calling txp:rss_suparchive from within txp:article.
All the ‘undefined variable’ warnings are due to the fact that some columns were added to the textpattern table after rss_suparchive was released and the plugin needs to be modified to be able to handle those properly (which is probably documented in the plugin support topic for that plugin).
Offline
#4 2010-10-26 19:39:24
- ajw-art
- Member
- Registered: 2010-02-10
- Posts: 33
Re: Tag can't be used outside article context when in article form
@merz1— Changing it to article custom worked! I didn’t think you could call article custom from within an article tag. I’m happy to be proven wrong.
It could be that I wasn’t using rss_suparchive in an article form before; I overwrote the old layout information on the site, so I can’t go back and check. It would explain why it went so wonky though.
@ruud— I wouldn’t have known rss_suparchive was encountering all those errors if I hadn’t switched on debug, actually. All I needed it to do was output the article thumbnails for me, and since that part was working I didn’t think anything else of it. I’ll head over to the thread and see if there were ever any fixes posted before the project was abandoned.
Offline