Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-27 18:53:34

amihai
New Member
From: Vancouver, Canada
Registered: 2007-04-27
Posts: 4

Displaying different articles by month

hey there, I would like to displays articles by month and was wondering how I can accomplish it with Textpattern.

For example, disregarding when articles were posted, I want to show 10 articles from September 1st to October 2nd. And 10 different articles from March 1st to April 20th etc. every year, recurring.

Your help would be greatly appreciated :)

Offline

#2 2007-04-28 07:28:14

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

Re: Displaying different articles by month

There is this method which you might need to alter. There is article_custom and I’m certain that there are other ways which i can not recall just now:)


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

Offline

#3 2007-04-28 21:21:48

amihai
New Member
From: Vancouver, Canada
Registered: 2007-04-27
Posts: 4

Re: Displaying different articles by month

Thank you but that doesn’t really accomplish what I need. For example, I need something that would accomplish the same thing as:

if september1-october2 {
//display this
}
if march1-april20 {
//display this
}

Is that possible?

Offline

#4 2007-04-29 06:52:57

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

Re: Displaying different articles by month

your example seems to be using a kind of a random personal date order which I do not think that it is supported as it is too specific. I would think that to achieve what you want will need manual insertion of the constraints.

Maybe Example 4 might be of help

Example 4: Will display articles that have a custom field named “colour” with a value “red”
<txp:article_custom colour="red" />

What you will need to do is have a custom field which you can name “date” and then call all articles using that variable

ie <txp:article_custom date="september1-october2" /> and for the next series <txp:article_custom date="march1-april20 " />

Last edited by colak (2007-04-29 06:53:22)


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 2007-04-29 21:12:38

amihai
New Member
From: Vancouver, Canada
Registered: 2007-04-27
Posts: 4

Re: Displaying different articles by month

Thanks a bunch. I ended up just doing it all in php between the <txp:php> tags. It’s unfortunate there isn’t a way to accomplish the same thing more simply with Textpattern.

Offline

#6 2007-04-30 20:15:41

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Displaying different articles by month

What you’re asking for is, frankly, rather odd, don’t you think? In other words: plugin.

Offline

#7 2007-05-01 02:43:54

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Displaying different articles by month

This ras-dates would give you that level of display control.

Offline

#8 2007-05-01 18:26:08

amihai
New Member
From: Vancouver, Canada
Registered: 2007-04-27
Posts: 4

Re: Displaying different articles by month

Yeah Mary, you’re right. It’s a little too complicated and going with a plugin is a better solution. Who knows, maybe I’ll make this into my first plugin :)

Thanks rsilletti, that’s pretty cool.

Offline

Board footer

Powered by FluxBB