Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-02-27 11:27:56

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

filter articles by month in specific section

i’ve three sections (news, reports, articles)
i want to have a navigation of months (January, Feb, etc…) each month has link to filter articles of that month in specific section.
any one plz help
thanks

Last edited by raminrahimi (2015-02-27 11:28:19)

Offline

#2 2015-02-27 11:47:41

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

Re: filter articles by month in specific section

Is this of any help?


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 2015-02-27 13:03:55

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

Re: filter articles by month in specific section

i tried that, but it will list the titles with link. i need like this: http://oi57.tinypic.com/2a65eev.jpg
if i’m on the section of News, when clicked on March -> that will list all articles of March

Offline

#4 2015-03-01 14:12:41

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: filter articles by month in specific section

The idea from colak is not bad.
You can change it for your article-list with title and body, without the archive-tree and without ul/li. Make a new variable, get the code “variable month” and set it for match article to months.

Maybe you wish sort with year too?

Another way would be with custom_field…

Offline

#5 2015-03-03 07:38:23

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

Re: filter articles by month in specific section

i installed smd_calendar and it’s fine for me i did manually for each months like this:
<a href=”<txp:site_url />?date=2015-01&s=news”>January</a>
<a href=”<txp:site_url />?date=2015-02&s=news”>Feb</a>
<a href=”<txp:site_url />?date=2015-03&s=news”>March</a>
etc..

Offline

#6 2015-03-03 11:26:17

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 256
Website

Re: filter articles by month in specific section

Or you could do this without any plugins. And – as a bonus, you’d only need to do something manually every year.


Prrrrrrrr

Offline

#7 2015-03-03 15:14:30

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: filter articles by month in specific section

TNT wrote #288712:

Or you could do this without any plugins. And – as a bonus, you’d only need to do something manually every year.

Performance-wise (atm) we’d better reduce the number of txp tags in loops, using wraptag and break attributes:

<txp:article_custom limit="999" section="articles" month="2009" sort="Posted desc" wraptag="ul" break="li">
	<txp:permlink><txp:title /></txp:permlink>, 
	<txp:posted format="%A %B %d, %Y" />, 
	<txp:rah_function call="rtrim" string='<txp:category1 title="1" link="1" />, <txp:category2 title="1" link="1" />' charlist=", "/>
</txp:article_custom>

Offline

Board footer

Powered by FluxBB