Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Archive lists by month (section, category, etc) with 4.0.2
Do you mean my solution or with the plug-in P ? With the plug-in you can use showexcerpt=”1” to display an article’s excerpt assuming it has one.
Last edited by thebombsite (2006-04-08 14:29:40)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#32 2006-04-08 14:54:31
- -P-
- Member

- From: Finland
- Registered: 2005-09-10
- Posts: 211
Re: Archive lists by month (section, category, etc) with 4.0.2
The site in question is an existing site that I´m converting to TXP. Well actually two sites, one made with html and other, blog, running with Movable. None of the blog posts use excerpts and I doubt they are willing to start using them even now.
Personally I prefer your way of archiving but for the client I´d also need to have list of months that have blog posts in the sidebar so by clicking selected month link takes you to page listing the whole entrys from chosen month. This is what they are used to have and are willing to maintain.
So… I don´t know what I mean, I know just that I´d like to be able to do this somehow :D
Offline
Re: Archive lists by month (section, category, etc) with 4.0.2
Confusion reigns. ;)
If you were using my version you could simply add <code><txp:body /></code> under the “Title” tag in the FORM template.
For the plug-in you could use the showexcerpt=”1” attribute then hack the plug-in to pick up $body instead of $excerpt.
If you decide which way you want to go I can give more detailed help. ;)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#34 2006-04-08 16:19:47
- -P-
- Member

- From: Finland
- Registered: 2005-09-10
- Posts: 211
Re: Archive lists by month (section, category, etc) with 4.0.2
:D
Can I pull links from your solution and add them to the sidebar? So when clicking “November” it shows only blog posts from november etc.?
If not, then I assume I´d have to use plugin.
Offline
Re: Archive lists by month (section, category, etc) with 4.0.2
First thing to mention is that I’m trying to develop a form specifically for your sidebar here. You can watch it as I do it if you like.
Second point to mention is that with my method, the actual archive page itself will be a full archive however, with the built-in “Back to the Top” links and the menu at the top, it is quite easy to get around even though it will probably be a very long single page.
I now need to sort out the links for the sidebar menu so that they take you straight to the month you are looking for. :(
Last edited by thebombsite (2007-01-27 23:07:42)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Archive lists by month (section, category, etc) with 4.0.2
How’s that then? Would that suit your purpose?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#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
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
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
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>ä</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
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