Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-03 18:58:01

frotzed
Member
From: Planet Earth
Registered: 2007-05-08
Posts: 20
Website

How do I display one posted date for all the articles on that day?

The site I’m trying to emulate is here: http://anarchaia.org/

you see how the site has one date and then under it are all the posts from that day. Then the next date, and all the posts under that date. How would I go about doing this?

I obviously can’t put <txp:posted /> in any form, it has to go in the default page. but if I do that then it only displays the posted date once on the top of my site and that’s it. I’m kinda stumped.


Ben Gray | ben@openswitch.org | http://openswitch.org

Offline

#2 2007-08-03 19:41:50

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: How do I display one posted date for all the articles on that day?

You can put <txp:posted /> into the article form, but you’ll have to embrace it with <txp:if_different>...</txp:if_different>. So, your article form would look somehow like this:

<txp:if_different><txp:posted /></txp:if_different>
<txp:title />
<txp:body />

On your page template, you just use the ordinary <txp:article /> tag.

<txp:if_different /> takes any content, be it plain text, HTML or Textpattern tags, and renders its outcome in case it differs from any previous output produced by the same markup on a page. In your case, this would happen with any article posted on a different date than all the articles above it.

See Textbook for further details.

Offline

#3 2007-08-03 20:18:08

frotzed
Member
From: Planet Earth
Registered: 2007-05-08
Posts: 20
Website

Re: How do I display one posted date for all the articles on that day?

Man, I should have known that. Thanks bud, I feel like a doofus. I’m kinda new to Txp but I’m hooked for life. This is the best CMS on earth.


Ben Gray | ben@openswitch.org | http://openswitch.org

Offline

Board footer

Powered by FluxBB