Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-08-13 08:38:16

skywise
New Member
Registered: 2012-08-13
Posts: 5

Showing articles by month

I have been trying to find a way to get a sidebar that shows something like this:

2012 august july juni may etc…
2011 december etc…

The function I want when clicking on the months is to open a page that shows all the articles for that month in whole – NOT just a listing with article titles or an excerpt.

All help would be much appreciated. Or if you just could send me in the right direction. :)

Thnx. /Skywise

Offline

#2 2012-08-13 09:05:06

skywise
New Member
Registered: 2012-08-13
Posts: 5

Re: Showing articles by month

I posted a little bit too fast :) Found the upm_date archive. :D Happy trails!

Offline

#3 2012-08-13 12:51:12

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Showing articles by month

You don’t need a plug-in. Something like this does it very nicely using native TXP tags.

<h2>Archive by Month</h2> <txp:article_custom section="articles" wraptag="ul" class="" break="li"><txp:if_different><a href="<txp:site_url /><txp:section />?month=<txp:posted format="%Y-%m" />"><txp:posted format="%B %Y" /></a></txp:if_different></txp:article_custom>

Offline

#4 2012-08-13 15:48:50

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: Showing articles by month

this article might be of particular interest to you.

following its instructions i’ve made the sidebar on this page which is currently not very much populated but would show 2012, 2011, 2010 etc. if there would have been any exhibitions.

this is the code for the sidebar:

		<txp:article_custom limit="9999" sort="Posted desc" break="" section="exhibitions" wraptag="ul" class="secondary-menu archive" time="any"> <!-- exhibition detail and list page -->
		    <txp:if_different>
		    	<li><a href="<txp:site_url /><txp:section />/?month=<txp:posted format="%Y" />"><txp:posted format="%Y" />.</a></li> <!-- add date context to url:http://ipsedixit.net/context_demo/136/date-context  -->
		    </txp:if_different>
		</txp:article_custom>

what will be shown on the respective page depends on the tags you use. take <txp:body /> for example and you’ll get the full article body.

hope that helps.

Offline

Board footer

Powered by FluxBB