Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Article within an article
Hello,
is there any way to nest an article within an article, such as writing <txp:article_custom category="somecategory" />
in the textile article field?
Thanks
Offline
Re: Article within an article
Untested.
Your code is not returning an article but a list of articles… i think.
If you wish to use this extensively you could create a custom field named nested and in your page template you could have something like
<txp:if_custom_field name="nested">
<txp:article_custom id='<txp:custom_field name="nested" />'>
<txp:body />
</txp:article_custom>
</txp:if_custom_field>
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: Article within an article
Manaus wrote:
is there any way to nest an article within an article, such as writing
<txp:article_custom category="somecategory" />
in the textile article field?
Yes, by doing exactly what you say: just put that code into your article body.
Code is topiary
Offline
Re: Article within an article
Thanks everybody for the quick answers
@jsoo: I tried out your suggestion, but txp returns a circling reference error (the article loads himself)…
Offline
Re: Article within an article
you can also try
notextile. <txp:article_custom id="123">
<txp:body />
</txp:article_custom>
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: Article within an article
Manaus wrote:
Thanks everybody for the quick answers
@jsoo: I tried out your suggestion, but txp returns a circling reference error (the article loads himself)…
Ah — right. You do need to avoid that case. It’s safe to put article_custom
into an article body otherwise. So, using article_custom category="something"
, you would have to use a category not assigned to the current article to be on the safe side.
Code is topiary
Offline
#7 2011-03-10 23:15:23
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Article within an article
Manaus wrote:
I tried out your suggestion, but txp returns a circling reference error (the article loads himself)…
When I created a sitemap in an article, as described in this TXP Tip, I found out that when using an article_custom tag in an article, “you must specify a form in the article_custom call that is different from the form the article itself is called by, to avoid a circular reference.”
Last edited by els (2011-03-10 23:16:03)
Offline
Re: Article within an article
Els wrote:
When I created a sitemap in an article, as described in this TXP Tip, I found out that when using an article_custom tag in an article, “you must specify a form in the article_custom call that is different from the form the article itself is called by, to avoid a circular reference.”
OK, so that’s what I missed. I had tested it out, but using article_custom
as a container tag.
Code is topiary
Offline
Pages: 1