Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-01-04 16:52:49

vickilh
Member
Registered: 2007-10-30
Posts: 96

article list in different category

I can’t figure out what I’m doing wrong. I want to display a list of the articles with category “news-story” when I am on the article with section “kids-news”. But what I get is just a link to the kids-news page for the content.

Thanks for any help!

<txp:if_article_category name="kids-news">
	<txp:article_custom section="Children" category="news-story" limit="12" />
	<p><txp:permlink><txp:title /></txp:permlink><br />
		<txp:excerpt /></p>
	</txp:article_custom>
</txp:if_article_category>

Offline

#2 2013-01-04 17:08:03

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: article list in different category

Ah! I needed to remove the closing “/” in my first article_custom statement. Now it shows nothing.

Offline

#3 2013-01-04 17:25:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: article list in different category

Do you have any articles using both the section Children and the category news-story?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2013-01-05 04:43:04

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: article list in different category

Yes, there are two articles. – This should work, right? I can be in one article category and I can make an article list of another category? thanks!

Offline

#5 2013-01-05 05:54:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: article list in different category

vickilh wrote:

I can be in one article category and I can make an article list of another category?

indeed you can when you use article_custom which is what you are doing. i’m wondering if it recognises that the article is in the category.

can you change your code to

<txp:if_individual_article>
<txp:if_article_category name="kids-news">
	<txp:article_custom section="Children" category="news-story" limit="12">
	<p><txp:permlink><txp:title /></txp:permlink><br />
		<txp:excerpt /></p>
	</txp:article_custom>
</txp:if_article_category>
</txp:if_individual_article>

Also put the site in debug mode and search the source of the front end page in question for <txp:if_article_category to see if it returns true or false.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2013-01-05 15:56:35

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: article list in different category

That worked!! :-)

Thanks so much!

Offline

Board footer

Powered by FluxBB