Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2007-10-12 07:30:55

majkinetor
Member
Registered: 2007-10-10
Posts: 13

Re: How to display articles of the same category as currently displayed.

You have a typo there, and I think it breaks all the TxP parser.

Yes, I tend to forget to close the tag, but that wasn’t causing the problem:

tag_error <txp:title/> -> Textpattern Notice: Article tags cannot be used outside an article context on line 1887

I really don’t understand why <txp:title/> or any other doesn’t work inside if_single_article tag. I can only understand that forms launched by txp:article are the only place to use them. I also tried <txp:output_form form="article_title" /> instead <txp:title/> where artcile_title contains only <txp:title/> but it didn’t work again. How that can be ? Am I not getting something fundamentaly important ? The textbook says: The title tag is a Single_Tag which is used to return the title of the article being displayed. This tag is used in an article form.* and in that code it *is used in article form….

To continue investigation, I tried <txp:category1 /> instead title. Textbook says This tag may be used within either an article Form, or, in a page, wrapped in an if_individual_article conditional tag.. I get the same error as with title.

The above code doesn’t make too much sense for me…

Appart from lost div, it doesn’t, if you add attribute category = “?” and chh_article which was the point. I just checked here if chh_article works. And that proves me that doesn’t as above code works while the same thing with chh doesn’t.

Last edited by majkinetor (2007-10-12 07:43:28)

Offline

#14 2007-10-12 07:45:53

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

Re: How to display articles of the same category as currently displayed.

majkinetor wrote:

tag_error <txp:title/> -> Textpattern Notice: Article tags cannot be used outside an article context on line 1887

Are you using it a context of an sticky article? I have reported that article tags doesn’t work in page templates when in sticky article context. It seems to be a bug and will be fixed in the next version.

Article tags can be used in page templates and they work for live articles.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#15 2007-10-12 08:34:30

majkinetor
Member
Registered: 2007-10-10
Posts: 13

Re: How to display articles of the same category as currently displayed.

2 thebombsite
Your idea acctually worked :D. Everything worked as expected :) Thank you. Thank you.

I managed to do it anotherway, and this can perhaps be used as a general way to show single article.
This code behaves normaly:

<txp:if_individual_article> <txp:article form=“article” status=“5” />
</txp:if_individual_article>

while the same code with article_custom tag doesn’t i.e. it always displays the same sticky article no matter what I clicked. I realised that behavior is part of the context sensitvie difference between those 2.

With <txp:article_custom form="article" status="5"/>

I get always the same article no matter what link is clicked. This is expected due to the non-context senistive behavior of this tag.

<txp:article_custom form=“article” id=“2”/>

also works without complaints and shows the very same article here.

Now

<txp:id/>
<txp:article_custom form="article" id="2"/>

shows the right article id above the article which made me think about:


<txp:if_individual_article>
<txp:asy_wondertag><txp:article_custom form="article" id="<txp:id/>"/></txp:asy_wondertag>
</txp:if_individual_article>

as a definite way. So both thebombsites and above code produce the same output.

Last edited by majkinetor (2007-10-12 08:40:35)

Offline

Board footer

Powered by FluxBB