Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Automatically list articles divided by their category or custom field
I’ve got categories, and I mean lots of them, and I’d like to list articles divided into them like this:
Category 1 – article1 – article 2 – …
Category 2 – all articles in category 2
Category X -…
And so on as many as there are different categories in one parent category..
The problem itself is this:
I’ve got news and each news are connected to a city and a province.
Then I’d like to list those news not by date, but by city, and when the city changes, there should be a name of that city (which is the name of the category1/2 or the name of the custom field, whichever is possible to make)
I know how to list all articles from a section sorted by that category, but outputting the name of the category every time is beyond me.. Also I can’t make a static page that lists city1’s all articles and then city2’s, because first of all it’s very time consuming as there are tens of cities, and secondly there will be new cities also (new categories or new info on custom field) and then it would be necessary to make changes to that static page again :/
I hope I’m not explaining too hard, this is like doing a txp:category_list, but with their connected articles listed below the titles :)
Offline
#2 2006-01-16 15:43:01
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: Automatically list articles divided by their category or custom field
I am using rss_suparchive_bycat which you can see in action on txp resources in the right sidebar.
Offline
Re: Automatically list articles divided by their category or custom field
thnx, sounds just what I need, will try tomorrow at work :)
Offline
Re: Automatically list articles divided by their category or custom field
Yeps, works just as I wanted, but is it normal that it takes a lot of CPU, compared to a page request for a single article listing the links of 2 newest articles from each categories (about 20 cats) takes 3-4 more CPU time..
I sure hope this company packs some more firepower on their web server than my 800MHz Celeron workstation ;D
Offline
Re: Automatically list articles divided by their category or custom field
Try using txp:if_different
tag. Look here for some examples.
Offline