Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2006-04-08 17:01:13

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

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

It definitely would!!!! :D Looks great!!

While you were making that, I tryed to hack superarchive plugin to show body instead of excerpt. Off course with no success.
Could I have both, please? Could I? That would be just perfect, to be able to make New Stuart Style Archives or the old Movable style. Well, in most cases I can now just ditch the plugin and use your archiving.

Offline

#38 2006-04-08 17:05:35

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

How do you mean “Both”?


Stuart

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

Offline

#39 2006-04-08 17:17:23

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

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

It is enough to learn one solution to be able to make those month links in sidebar but it would be even better if could learn the both ways. Meaning that I could choose between two archiving presentation options based on which suits the site and requests best.

So I could either make your style archives or use the plugin. But as I said, I will settle for one :)

Offline

#40 2006-04-08 17:22:05

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

I should be able to do both but I think we may still be an hour ahead of you here and it is time to eat. The chef (that’s me) insists that I eat it whilst it’s hot like Mommy always told me so if you don’t mind waiting a bit. As there is a bit of code involved with my method I might add a part 2 to my original FreshText article and just post the plug-in hack here.


Stuart

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

Offline

#41 2006-04-08 18:00:11

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

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

Sounds great! And no hurry, this isn´t any “has to happen now”- thing. For now, I am happy enough just to know that it can be made. I am just like enthuastic little child with TXP, every day I learn more´n more stuff and at the same time I start popping these silly questions of If I can do this, can I also do that etc. :D

p.s. I am actually two hours ahead of you here ;P

Offline

#42 2006-04-08 19:05:50

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

Two hours eh? And there was I trying to be so “European”. Doesn’t work does it? ;)

Anyway I think this is what you have been waiting for.

Now remember that I don’t use the plug-in so I’m going to rely on you telling me if this works or not. :)

Go into the “Edit” screen for the plug-in and nearly halfway down (my little scroll button was almost halfway down the edit screen) you should see this block of code:-

<code>
foreach($res as $a) {
$date = date($dateformat,$a[“posted”]);
$subdate = date($subdateformat,$a[“posted”]);
$title = ($a[“url_title”]) ? $a[“url_title”]: stripSpace($a[“title”]);
$title = ($url_mode) ? $title : ‘’;
$showtitle = $a[“title”];
$section = $a[“section”];
$id = $a[“ID”];
$cat1 = $a[“category1”];
$cat2 = $a[“category2”];
$author = $a[“authorid”];
$excerpt = $a[“excerpt”];</code>
<br />

That very last line, change it to <code>$excerpt = $a[“body”];</code> then use the showexcerpt=“1” attribute in your tag and hopefully you should get the full body text instead.

Last edited by thebombsite (2007-01-27 22:58:01)


Stuart

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

Offline

#43 2006-04-09 14:48:59

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

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

Jippee!! :D

That works like a charm!

The second solution with the plugin I was not able to get to work. Installed clean superachive. Made some entries with excerpt and showexcerpt was set to yes in the plugin. And the excerpt was shown like it should. When I changed that very last line to <code>$excerpt = $a[“body”];</code>, the excerpt also disappeared and no body text either.

edit: for us poor people who have weird characters like ä (<code>&auml;</code>) in their month names it might be better to replace in the archive_sidebar and archives page the <code>%B</code> in the url to <code>%m</code>

archive_sidebar:
<code><txp:if_different>
<li class=“month”><a href=”/sectionName#Y<txp:posted format=”%Y%B” />”><txp:posted format=”%B” /></a></li>
</txp:if_different></code>

to:
<code><txp:if_different>
<li class=“month”><a href=”/sectionName#Y<txp:posted format=”%Y%m” />”><txp:posted format=”%B” /></a></li>
</txp:if_different></code>

archives:
<code><txp:if_different>
<a name=“Y<txp:posted format=”%Y%B” />” id=“Y<txp:posted format=”%Y%B” />”></a><h3 class=“className”><txp:posted format=”%B” /></h3>
</txp:if_different></code>

to:
<code><txp:if_different>
<a name=“Y<txp:posted format=”%Y%B” />” id=“Y<txp:posted format=”%Y%m” />”></a><h3 class=“className”><txp:posted format=”%B” /></h3>
</txp:if_different></code>

So it will output url /sectionName#Y2005monthnumber instead of /sectionName#Y2005monthname

Sorry about the amount of code, didn´t now how to explain it otherwise :D

Last edited by -P- (2006-04-09 15:42:54)

Offline

#44 2006-04-09 17:38:24

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

Well as I say in the article you can format the anchor link how you like as long as it matches the anchor in the archives page. Other than that was it easy enough to follow?

I’ll look at the plug-in again. Maybe I have “body” wrong or I’ve missed some little trick somewhere. I’ll get back on that. :(


Stuart

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

Offline

#45 2006-04-09 18:11:35

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

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

Yes, very good documentation! Thank you :)

Offline

#46 2006-04-09 19:51:39

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

I’ve emailed you about the plug-in. :)


Stuart

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

Offline

#47 2006-05-29 17:18:01

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

I’ve added a second article explaining how to produce a menu in your sidebar that will link to your archives using this method. No plug-ins were harmed in the creation of this article.

Last edited by thebombsite (2007-01-27 22:59:06)


Stuart

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

Offline

#48 2006-08-23 23:14:59

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

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

Achieving an archive list by category was no problem thanks to zem’s great FAQ, but I searched high and low for a way to make the articles in each category be sorted alphabetically. The answer was buried deep in stu’s article mentioned above, but I think it’s useful so have added it here:

The article_custom tag can take more than one sortby criteria e.g. for an alphabetic list of articles grouped by category use sortby="category1,title" in your initial article_custom tag. Wonderful!


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB