Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2005-12-03 14:39:27

Dufresne
Member
Registered: 2005-09-19
Posts: 22

Re: Archive lists by month (section, category, etc) with 4.0.2

Just in case this comes in handy for other people, you can use this technique for events as well.

All you need to do is add the time=“future” to the article custom tage like so:

<code><txp:article_custom limit=99999 form=“monthly_article” section=“events” time=“future” /></code>

And voila! a list of upcoming events by year and month.

As i want to archive news and events i’ve done the following on the archive_list page templage
<code>
<txp:if_section name=“events_archive”>
<txp:article_custom limit=99999 form=“monthly_article” section=“events” time=“future” />
</txp:if_section>
<txp:if_section name=“news_archive”>
<txp:article_custom limit=99999 form=“monthly_article” section=“news” />
</txp:if_section>
</code>

Hope this comes in useful

Offline

#17 2005-12-05 18:02:05

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

Re: Archive lists by month (section, category, etc) with 4.0.2

Dufresne: This is a nice example, you might repost it under its own title, it would make it easier for folks to find.

Offline

#18 2005-12-15 07:52:26

shafi707
Member
Registered: 2005-12-01
Posts: 17
Website

Re: Archive lists by month (section, category, etc) with 4.0.2

Yes..this is what I was looking for..


http://tech-resource.info

Offline

#19 2005-12-31 06:57:08

Anark
Member
Registered: 2004-08-14
Posts: 101

Re: Archive lists by month (section, category, etc) with 4.0.2

Thanks, Zem!

As it is, the Year and Month headings are marked up in H2 and H3 tags respectively but the permalinks lack any markup except for the break tags.

If I take the advice given in the FAQ and use li tags in the form and ul tags around the txp:article_custom tag on the page, I end up with everything, including the headings, inside one all-embracing ul tag, which isn’t what I wanted. I wanted a new list for every month.

How do I mark up the permalinks either as a list or as lines in a paragraph?

Offline

#20 2005-12-31 17:06:07

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

Re: Archive lists by month (section, category, etc) with 4.0.2

Use something like this as your article form:

<code>
<txp:if_first_article>
<ul class=“empty”>
</txp:if_first_article>
<txp:if_different>
<!— <txp:posted format=”%B” /> —>
</ul>
</txp:if_different>
<txp:if_different>
<h2><txp:posted format=”%Y” /></h2>
</txp:if_different>
<txp:if_different>
<h3><txp:posted format=”%B” /></h3>
<ul>
</txp:if_different>
<li><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article>
</ul>
</txp:if_last_article>
</code>

You’ll end up with an empty UL at the beginning, which isn’t ideal, but you can style it away.

Offline

#21 2006-01-01 02:33:00

Anark
Member
Registered: 2004-08-14
Posts: 101

Re: Archive lists by month (section, category, etc) with 4.0.2

Cool. Thanks!

Offline

#22 2006-01-01 09:49:32

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

Re: Archive lists by month (section, category, etc) with 4.0.2

one of the cool features rss_superarchive has is the ability to also list articles by section/category. A feature indispensable for those who wish to create site maps. Can someone point towards a method with wich this can be achieved without the rss_suparchive?


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

Offline

#23 2006-01-01 15:49:44

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Archive lists by month (section, category, etc) with 4.0.2

You could follow my little explanation. Including “sections” would be similar to the category method I have explained but would also be similar to the year/month method in that there are 2 “if_different” calls.

Last edited by thebombsite (2007-01-27 23:05:07)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#24 2006-01-03 08:10:51

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

Re: Archive lists by month (section, category, etc) with 4.0.2

thanks stu
Your explanation helped me loads. Did it slightly differently but the kick start was definitely provided in your text.


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

Offline

#25 2006-01-12 17:39:11

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Archive lists by month (section, category, etc) with 4.0.2

What I’d really like to do is produce a Nested List so I can collapse it.

UPDATE Looks like it’s not possible… Poop! See this post.

Something like:

<code>
<ul class=“Archive”>
<li>2004
<ul>
<li>January
<ul>
<li><a href=”#”>Article 1</a></li>
</ul>
</li>
<li>February
<ul>
<li><a href=”#”>Article 1</a></li>
</ul>
</li>
</ul>
</li>
<li>2005
<ul>
<li>January
<ul>
<li><a href=”#”>Article 1</a></li>
</ul>
</li>
<li>February
<ul>
<li><a href=”#”>Article 1</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</code>

Is this possible? trying out loud…
I’ll post what I find out.

Last edited by mrdale (2006-01-12 18:44:19)

Offline

#26 2006-01-12 21:31:14

mikeg
Member
From: Edmonton, Canada.
Registered: 2005-02-21
Posts: 31
Website

Re: Archive lists by month (section, category, etc) with 4.0.2

Just thought I’d pass this on for information. I came up with this solution. I wanted Header tags for the year and month with the individual days as list items in a properly marked-up list. Here is what I did:

In the “archive” page template:

<ul style="display: none;">
<li style="display: none;"></li>
<txp:article_custom limit=99999 form="monthly_article" section="article" /> </ul>

<p>This creates a dummy <ul> at the beginning of the list, but it won’t break your validation, if you care enough, that is. Otherwise, you could just omit the dummy <ul> and <li></li> that I have shown here.</p>

<p>And in the monthly_article form:</p>

<txp:if_different>
</ul>
<h2><txp:posted format="%Y" /></h2>
</txp:if_different>
<txp:if_different>
<h3><txp:posted format="%B" /></h3>
<ul class="archive_list">
</txp:if_different>
<li><txp:posted format="%d" /> - <a href="<txp:permlink />" title="Permanent link to ' <txp:title /> '"><txp:title /></a></li>

<p>That’s it. Hope it helps someone…</p>

Last edited by mikeg (2006-01-12 21:34:39)


“I love Beethoven. Especially the poems.”
- Ringo Starr

Offline

#27 2006-01-18 23:24:23

pericat
Archived Plugin Author
From: Vancouver, BC
Registered: 2006-01-12
Posts: 4
Website

Re: Archive lists by month (section, category, etc) with 4.0.2

It certainly helped me. Thanks!

Offline

#28 2006-01-24 17:13:19

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Archive lists by month (section, category, etc) with 4.0.2

OK This is wierd… I’ve used the archive technique to great effect, but… I notice that when a page is arrived at via a calendar(mdp_calendar) and has a date based url, thearchive will obly display the articles for that day in the archive.

Any thoughts?

Offline

#29 2006-03-18 02:37:22

Nell
Member
From: Mexico City, Mexico
Registered: 2005-06-21
Posts: 48

Re: Archive lists by month (section, category, etc) with 4.0.2

I did it this way with a definition list. This makes the date headers and each post a list item, with no empty <code>ul</code>s.

<code>
<txp:if_different>
<dt><txp:posted format=”%B %Y” /></dt>
</txp:if_different>
<dd><txp:permlink><txp:title /></txp:permlink></dd>
</code>

Last edited by Nell (2006-03-18 02:38:49)

Offline

#30 2006-04-08 08:33:57

-P-
Member
From: Finland
Registered: 2005-09-10
Posts: 211

Re: Archive lists by month (section, category, etc) with 4.0.2

I read some bit confusing threads here. But the thing is that I´d still need to make monthly archives for a client in a way that archives are presented as a article list. So when you are on the blog section of the site, in the sidebar there is Archives listed by january, february etc. and clicking a month takes you to listing where all the posts are presented from the whole month. Not just the post titles with a link to the actual post but a full article list.

Yes, talking here about movable type archives handling. In generally I use Stuarts exellent solution making archive page summary and with rss_superachive I can make month listing. But with it I can not list the whole posts, only the post titles. Or can I?

Offline

Board footer

Powered by FluxBB