Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-19 17:48:47

alittle116
Member
From: Brooklyn
Registered: 2005-09-14
Posts: 72
Website

list of recent articles WITH categories

Is there anyone to make a list of the 5 most recent articles and display the section or categories under each article title.

For example:

RECENT ARTICLES:

1. My Cat Smells
Categories: My Cat, Things that Smell

2. I Got a New Cat
Categories: My Cat, Me

3. I Smell
Categories: Me, Things that Smell

etc….

Offline

#2 2006-05-19 19:03:34

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

Re: list of recent articles WITH categories

Something like this:
<code>
<ol>
<txp:article limit=“5” listform=“recent_articles” />
</ol>
</code>
Form ‘recent_articles’:
<code>
<li><txp:permlink><txp:title /></txp:permlink><br />
Categories: <txp:category1 title=“1” /> <txp:category2 title=“1” /></li>
</code>
Note that txp:article will only output articles in the current section, or, if on the frontpage, articles in sections that are set to be displayed on the frontpage. If you need it in another context you’d better use txp:article_custom.

Offline

#3 2006-05-19 19:42:25

alittle116
Member
From: Brooklyn
Registered: 2005-09-14
Posts: 72
Website

Re: list of recent articles WITH categories

this seems to be working. thanks!

Offline

#4 2006-05-22 17:14:50

anoke
Archived Plugin Author
Registered: 2006-04-15
Posts: 152

Re: list of recent articles WITH categories

Eww – stinky cats.

You might want to use chh_if_data if you don’t want to display empty cat when article has no cats.

That plugin has many other nice uses aswell.

meow.


- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -

Offline

Board footer

Powered by FluxBB