Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-06-14 00:01:15
- reptilerobots
- Member
- Registered: 2005-08-20
- Posts: 72
A list where some items display a special “NEW” tag
I am generating an alphabetical list of articles (individual pieces of my portfolio), there are 3 sections – design, illustration, and drawings, which would mean that there are 3 lists – I want whichever the newest article is in each section to say NEW or display a text glyph next to the item. I know that one way to do this would just simply type NEW or enter the glyph in the title, but I would like it to function in a more automatic way. Whichever the newest items are, lets say, the last 2 posted in a section would automatically say NEW next to it. I suppose there would also be a way to create a category called NEW and assign it to the appropriate articles, but then I would have to un-assign the category when I uploaded new ones. Is there a plugin that can do this, or some conditional statement?
Offline
#2 2006-06-14 10:29:03
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: A list where some items display a special “NEW” tag
Try csb_if_newer_than :)
Offline
#3 2006-06-14 17:06:26
- reptilerobots
- Member
- Registered: 2005-08-20
- Posts: 72
Re: A list where some items display a special “NEW” tag
Thanks – I have it installed, but what is context of the plugin ? do you have to create a form that is output in the article? or does it surround an article list? I cant seem to find much information.
Offline
#4 2006-06-14 18:14:08
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: A list where some items display a special “NEW” tag
I am using it here, in an article list that contains only the article titles, to output ‘new’ after the title if an article is newer than 30 days. This is the code I use in the article form:
<code>
<txp:permlink><txp:title /></txp:permlink> <txp:csb_if_newer_than days=“30”><span class=”<txp:category1 />-new”>nieuw</span></txp:csb_if_newer_than><br />
</code>
Offline
#5 2006-06-14 18:16:57
- reptilerobots
- Member
- Registered: 2005-08-20
- Posts: 72
Re: A list where some items display a special “NEW” tag
thank you – I will try to integrate it into my new website!
Offline