Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-12-14 22:47:48

richtestani
Plugin Author
Registered: 2009-11-08
Posts: 128

Sort by other date (not publish date)

I have a set of articles that are event related, and would like to sort by the event date rather than the publish date.
Any ideas how I can do this?

Thanks
Rich

Offline

#2 2009-12-14 23:16:53

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Sort by other date (not publish date)

You can set the publishing date to match the event date. Article tags (<txp:article[_custom] />) have time attribute which can be set to any / future.

Alternatively, you can place the event date (example 2009-12-26) into a custom field and use the field as a sort criteria (sort="custom_1 desc").

Last edited by Gocom (2009-12-14 23:19:09)

Offline

#3 2009-12-15 15:41:54

richtestani
Plugin Author
Registered: 2009-11-08
Posts: 128

Re: Sort by other date (not publish date)

I thought about using the publish date field – i wasn’t sure how that would affect the listing. If I put a publish the date of the event (say in two month) does the article not display until that event or does it just stay on top of everything til there is something further in the furture?

thanks for the tips!
Rich

Offline

#4 2009-12-15 16:00:49

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,250
Website GitHub Mastodon Twitter

Re: Sort by other date (not publish date)

richtestani wrote:

I thought about using the publish date field – i wasn’t sure how that would affect the listing. If I put a publish the date of the event (say in two month) does the article not display until that event or does it just stay on top of everything til there is something further in the furture?

hi richtestani

the article will display if you have something like <txp:article time="future" />. Check ou the article attributes at the textbook


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2009-12-15 17:42:30

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Sort by other date (not publish date)

If you end up using a custom field to hold your data you can more easily select the date using my msd_admin_datepicker: jQueryUI Date Picker in the Write Tab plugin.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

Board footer

Powered by FluxBB