Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-27 22:36:53

Sono Juventino
Member
From: Skedsmo, Norway
Registered: 2007-12-22
Posts: 81

News not sorted for Categories pages. (Done)

My problem is that all my categories displays the same news. By clicking the link to categories, I thought I would get sorted out just the articles related to that category, but it seems I was wrong.

I currently only got one page and that is default. Should I use pages for this kind of sorting instead?

My site http://juvenorge.com Frontpage

My article display code:

<txp:if_individual_article> <txp:article allowoverride="0" form="full_news" pgonly="0" /> <txp:else /> <txp:article_custom limit="1" /> <txp:article_custom limit="1" offset="1" form="small_news_left" /> <txp:article_custom limit="1" offset="2" form="small_news_right" /> </txp:if_individual_article>

Last edited by Sono Juventino (2007-12-29 17:18:31)

Offline

#2 2007-12-27 22:44:04

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: News not sorted for Categories pages. (Done)

article_custom does not do that kind of filtering. You need to use the article tag.

Offline

#3 2007-12-28 15:19:41

Sono Juventino
Member
From: Skedsmo, Norway
Registered: 2007-12-22
Posts: 81

Re: News not sorted for Categories pages. (Done)

Ok, that was quite simple, Mary. Txp is just amazing. Very light, but still extremly powerfull. Loads of plugins and great support!

Im still not getting it 100% right. The problem is that I want sorted out just the articles from “news” at the frontpage. Now, I’m getting articles in the right category, but they also appear at the front page. This is my article display code:

<txp:if_individual_article> <txp:article allowoverride="0" form="full_news" pgonly="0" /> <txp:else /> <txp:article limit="1" /> <txp:article limit="1" offset="1" form="small_news_left" /> <txp:article limit="1" offset="2" form="small_news_right" /> </txp:if_individual_article>

Maybe that was a really bad explanation, but I guess it’s still understandable. Sorry for my bad English though.

Last edited by Sono Juventino (2007-12-28 15:20:48)

Offline

#4 2007-12-28 16:05:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: News not sorted for Categories pages. (Done)

Is ‘news’ a section or a category?

Offline

#5 2007-12-28 17:44:40

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: News not sorted for Categories pages. (Done)

I’m not entirely sure what you’re trying to get. How’s this:

<txp:if_individual_article> 
	<txp:article pgonly="0" allowoverride="0" form="full_news" />
<txp:else />
	<txp:if_category>
		<txp:article />
	<txp:else />
		<txp:article_custom category="news" limit="1" />
	</txp:if_category>

	<txp:article_custom category="news" limit="1" offset="1" form="small_news_left" />
	<txp:article_custom category="news" limit="1" offset="2" form="small_news_right" />
</txp:if_individual_article>

(Assumes “news” is the category you want on the front page.)

Offline

#6 2007-12-29 17:14:03

Sono Juventino
Member
From: Skedsmo, Norway
Registered: 2007-12-22
Posts: 81

Re: News not sorted for Categories pages. (Done)

That almost did it. I just moved form=“small_news_left and _right” below category=“news”. That worked very well.

Thanks again, Mary.

Offline

Board footer

Powered by FluxBB