Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-22 12:41:19

progre55
Member
Registered: 2006-05-02
Posts: 668

Archives: Accessing A Group of Articles By Date for a Particular Month

I think this is probably an easy one, but I have not been able to find the solution. I have looked at both Rob’s plug in and Mary’s plug in , but they are not exactly what I am looking for since I am already doing this on the site.

What I need is the ability to select an image (cover) and then have display a list of articles that fall within that particular date, which for my purpose can be the date stamp of the month that the articles were published.

An example would be: http://www.time.com/time/archive

Any assistance and guidance would be greatly appreciated.

progre55

Offline

#2 2008-07-22 17:06:59

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Archives: Accessing A Group of Articles By Date for a Particular Month

Would ras_if_dates do what you want?

Offline

#3 2008-07-22 17:31:59

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Archives: Accessing A Group of Articles By Date for a Particular Month

Ah, only 25 min too late ;)

From the FAQ: Here’s a step-by-step method for creating a page that lists all articles with headings for each month

You could use one of the known image replacement techniques (based upon the date you inject into the id value of the hn-tag) in order to show the relevant image.

Edit: Just remember IDs aren’t allowed to begin with numbers

Last edited by uli (2008-07-22 17:34:16)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#4 2008-07-22 18:00:26

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Archives: Accessing A Group of Articles By Date for a Particular Month

Thanks to both. I will take a look. And my bad for not checking the obvious FAQ, before posting.

progre55

Offline

#5 2008-07-23 21:13:39

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Archives: Accessing A Group of Articles By Date for a Particular Month

Els/Uli:

Thanks.

ras_if_dates did the trick.

progre55

Offline

#6 2008-08-14 03:14:55

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Archives: Accessing A Group of Articles By Date for a Particular Month

Els/Uli:

I thought I had this issue figured out, but I am still in need of assistance.

I am able to pull a group of articles up using the the following code in a form:

<txp:ras_if_dates_after setdate=“2008-7-01”>
<txp:ras_if_dates_before setdate=“2008-8-01”>
<txp:permlink><txp:title /></txp:permlink><BR>
</txp:ras_if_dates_before>
</txp:ras_if_dates_after>

My problem is that I now have a page with images (a cover for every month). What I want to occur is that you click on the image and it will pull up a list of articles for that given month. I figured that I could create articles for each month and attach the covers as the article image.

But that is where I cannot figure out the rest … how to automatically pull all the articles for a given month when the image is selected without creating numerous sections and forms for each image.

If it helps … all the articles I would want to show for a give month would have the same posted date.

Any and all assitance would be greatly appreciated.

progre55

Offline

#7 2008-08-14 06:40:38

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,729
Website

Re: Archives: Accessing A Group of Articles By Date for a Particular Month

how to automatically pull all the articles for a given month

txp:article_custom has a month attribute:

month=“yyyy-mm”
Restrict to articles posted within the specified month. Default is unset.

You could use an urlvar (?month=08&?year=2008) to pass the month you need in the link and and chs_if_urlvar to grab it and insert it into the txp:article_custom month attribute (you’ll need asy_wondertag or php to do tags in tags).

Finally, I’m not familiar with it but maybe upm_date_archive is also of interest.


TXP Builders – finely-crafted code, design and txp

Offline

#8 2008-08-14 06:44:07

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: Archives: Accessing A Group of Articles By Date for a Particular Month

I have recently forced to thought this kind article of collection too. I too invent I could do a section like “magazine covers archive”. When I have decided what articles belong to same “issue” I could write a post to that archive section. Article image would be the “cover” image. Articles itself would contain only permlinks to those original articles, maybe with some description texts. There propably is some easy way to include those needed posts to archive-article too, but if not, it is easy to write them if you are just starting.

If you already have millions of posts, you definately want more automatic version, like jakob presented during I wrote this.

Offline

#9 2008-08-14 16:20:25

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Archives: Accessing A Group of Articles By Date for a Particular Month

jakob/ultramega …. thanks for the input.

Here is how I solved the problem (with your assistance)

COVER Form
  • To display Cover Image (which is the Article Image) and Date (which is the actual Title of the Article i.e. August 2008)

<txp:article_custom section=“archives” sortdir=“desc” limit=“9999” form=“issue_form” />

ISSUE Form
  • To display articles in selected issue

<txp:asy_wondertag><txp:article_custom section=“article” sortdir=“desc” month=”<txp:posted format=”%Y-%m” />” form=“PermanentLinkTitle” /></txp:asy_wondertag>

Thanks to all who assisted me.

Last edited by progre55 (2008-08-14 16:22:32)

Offline

Board footer

Powered by FluxBB