Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Browsing by date plugin
Hi guys,
i’m new at Textpattern but have managed to set my blog up. I’m working at my archive and installed the akw_archive and akw_date_aware plug ins.
I managed to get my archive to work as intended, namely a list of months and years:
september 2004
august 2004
etc.
However i have one glitch:
if i click on september, i get the posts of august, if i click on august i get the ones of july,…. so it’s always a month off.
I only use my frontpage to show the archive list and have only 2 page templates: the default one and the archive one.
here are the tags i use:
<txp:akw_article_date_aware limit=“5” />
<txp:akw_month_list limit=“1000” archiveform=“entry_list” monthform=“entry_excerpt” form=“entry_full” headwrap=“h3” daywrapclass=“day-list” dayitemclass=“day” postwrapclass=“post-list” />
Note that i’m not using forms for these tags: i’m not sure if i need to and if so, how to set them up.
Does one of you have a clue as to why the archive shows off a month?
live page:
http://www.dzinelabs.com/blog/cms/
@dzinelabs
Offline
Re: Browsing by date plugin
Hey Luc,
Welcome to Textpattern. Read the post above yours. It looks like the problem is with the timezone settings in the admin area. Set the timezone to 0 until this bug gets fixed and see if that helps
Refresh Dallas and other Refreshing Cities.
Offline
Re: Browsing by date plugin
DUH! That’s what you get when scanning posts instead of read them carefully ;-)
Indeed, setting it to 0 did the trick.
Tnx a lot tinyfly.
Now i’m almost ready to replace my current blog with TextPattern :-)
I have a question about that but i guess i’ll post that somewhere else :-)
@dzinelabs
Offline
Re: Browsing by date plugin
I’ve just about given up attempting to get these plugins to work. I keep coming back and messing with it every couple of weeks. Not sure if it is my inexperience with the textpattern model, or just plain not understanding where in pages/forms/articles they were intended to operate.
rares back to throw towel in
Offline
Re: Browsing by date plugin
I modified the original code to get it to work they way I want (pull from section of my choice, don’t break down by days). I’ll lay it all out in this message. Proceed at your own risk.
Here’s the code of the plugin, with my changes. Copy this into the code window and click save:
<pre>//
// Archive 0.6 (g19) by Lex Konrad (nakedloftparty.com)
// Portions by Dean Allen
// Slightly adjusted by Aaron Murray (onotob.org)
// ——————————————————————————————-
// View switcher
function akw_archive($atts)
{
global $pretext,$txpac;
// ——————————————————————————————————————-
// Outputs list of articles grouped by year & month… useful for archive pages… killed body query
// MOD to accept date format
function akw_doArchiveArticles($atts)
{
global $pretext,$prefs,$txpcfg,$timeoffset;
extract($pretext);
if (is_array($atts)) extract($atts);
- $out[‘body’] = parse($Body_html); $out[‘excerpt’] = $Excerpt; $out[‘title’] = $Title; $out[‘url_title’] = $url_title; $out[‘category1’] = $Category1; $out[‘category2’] = $Category2; $out[‘section’] = $Section; $out[‘keywords’] = $Keywords; $out[‘article_image’] = $Image;
// ——————————————————————————————-
function akw_rel_link($atts, $thing) // LEX: Outputs relative link rather than permalink (MOD for url_mode)
{
global $thisarticle,$c,$pfr,$id;
// ——————————————————————————————
// Adds month label to archive entries
function akw_month_label($thismonthyear,$wraptag,$endwrap,$ytitle,$mtitle,$fromsection)
{
global $pfr,$s,$c;
// ——————————————————————————————
// Adds day label to archive entries
function akw_day_label($uPosted,$thisday,$dtitle,$fromsection)
{
global $pfr,$s,$c;
Next, I created a section called “archive” with a corresponding page. On that page I have the following tag, located where I want the archive display to show up (the page is basically the same as my “default” page, but with the tag below instead of the <code><txp:article /></code> tag):
<pre><txp:akw_archive limit=“5000” form=“archivelinks” archiveform=“archivelinks” hidedays=“yes” headwrap=“h3” fromsection=“article” /></pre>
Next, I created a form called “archivelinks” with a type of “article”, which looks like this:
<pre><li><txp:zem_link><txp:title /></txp:zem_link>
<br />
<txp:cnj_if_excerpt>
<div class=“excerpt”>
<strong>Excerpt</strong>:<br />
<txp:excerpt />
</div>
</txp:cnj_if_excerpt>
</li></pre>
Note, I had to install the plugin zem_link to get permlinks to work and cnj_if_excerpt to test for article excerpts.. Search the plugins forum for these plugins.
Do all of the above and you will have an archive page that looks something like this
Last edited by botono9 (2004-10-02 20:58:37)
The future is… now!
Offline
Re: Browsing by date plugin
botono9, could you post a link to a text file with the code or something? Textile seems to have messed with it.
Offline
#91 2004-10-27 05:11:23
- arakune
- Member
- Registered: 2004-10-23
- Posts: 13
Re: Browsing by date plugin
I must be three kinds of idiots today, because I’m really not getting this.
I’ve been playing with the date_aware and archive plugins, trying to figure out how this all fits together. I think I’ve got a handle on the date_aware plugin. I’m currently using it to create links to daily archive pages, by wrapping the following around <code><txp:posted /></code> inside an article:
<code>
<a nicetitle=“View posts for this day” href=’/index.php?y=<txp:posted format=“Y” />&m=<txp:posted format=“m” />&d=<txp:posted format=“j” />’>
</code>
There may be an easier way to do it, but it works for me, and generally makes things very happy :) Thanks so much for this plugin!
I’m getting stumped on creating an archive page, though. I see where you say to use something like
<code>
<txp:archive limit=“1000” lowform=“entry_list” medform=“entry_excerpt” form=“entry_full” headwrap=“h3” daywrapclass=“day-list” dayitemclass=“day” postwrapclass=“post-list” />
</code>
in your page body, which is fine. But obviously, I don’t want to be doing this on my default page. I’d want to create a new “page” for the archive (perhaps even use the “archive” page that’s already there).
But then, how do I link to that archive page from my default page. I have other plugins, which display site nav links in my sidebar (category lists, recent posts, etc.), and they all pull up the default page template. Likewise, permalinks use the default page template….. I presume the archive template exists for just this sort of thing, but see no way of calling it explicitly.
I realize that this is probably more of an TXP question that a plugin question :( but since I’m running into while trying to use the archives plugin, I’m hoping somebody here won’t mind taking a minute to shed some light ;)
Offline
Re: Browsing by date plugin
i did read over the four pages of this thread…
i seem to just not understand…
how do i make the posted dates in an article be linkable to their separate dates?
e.g.:
<a href=“http://thiswouldlinkto_2003-10entries”>October</a> <a href=“http://thiswouldlinkto_2003-10-05entries”>5</a>, <a href=“http://thiswouldlinkto_2003entries”>2003</a>
Article body goes here blah blah
i did look at the plugin description where it’s installed, but it’s actually not clear there even that you have to replace txp:article with txp:akw_article_date_aware…
all that said, this is a very useful plugin for a very extremely terribly useful feature that i’d really like to be using throughout my site! thank you
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
Re: Browsing by date plugin
I assume that since the author of this plugin hasn’t posted here since July, despite there being numerous questions about its use, that development on this plugin is effectively dead.
I would like to implore that somebody with better php skills than myself pick up the ball on this plugin and explain how to use it in a clear and concise manner. In non-programming speak.
Refresh Dallas and other Refreshing Cities.
Offline
#94 2004-11-03 21:49:03
- Remillard
- Plugin Author
- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: Browsing by date plugin
I myself admit to someone who never quite ever figured this one out. What sort of behavior do people actually want? Something like:
<code><txp:xxx_article_list_by_date month="10" year="2004" form="yyyy" /></code>
And have it spit out all the articles for that month? (And likewise for year, and perhaps day?)
Offline
Re: Browsing by date plugin
Remillard,
yes, that would be very nice also… the archive list that can be broken out/selected via year/month/day is a very cool thing indeed.
you know what else would be cool? having the date on an article be broken out into linkable month-day-year, so that someone can come across that article either randomly from a list of categories or its particular section, and say “hmm.. interesting article. i wonder what else was written that day/month/year” and easily click on that piece of the date accordingly.
:) that would be cool.
but i will very patiently wait for the day.
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
Re: Browsing by date plugin
Don’t worry… development isn’t dead. I was waiting on the release candidate before finishing the plugin work. I will start a new thread inclusive of this, the archive plugin, and any future date-related plugs. Bear with me, as I have some site-related work to do before I’m ready to update the public plugins.
Offline