Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Archives
alesh: read back through this thread again and look at what various people are asking for. You personally may only want something very simple, but others are asking for something which literally requires /year/month/day/ URLs.
You cooin’ with my bird?
Offline
#32 2005-09-30 21:04:21
- aesop1
- Archived Plugin Author
- Registered: 2004-09-19
- Posts: 142
Re: Archives
I think that is part of the conceptual confusion: for a date-based archive list, it is pretty non-essential to worry about having a clean URL. You can, in fact, mix clean and “dirty” URLs when necessary.
I recently hacked the doArticles function to make it date aware by creating a “dateaware” attribute for article_custom (I submitted this to the TXP development team, btw). This allows you to pull up a yearly archive (http://www.yoursitename.com/section/?date=2005), a monthly archive (http://www.yoursitename.com/section/?date=2005-08) or by day (http://www.yoursitename.com/section/?date=2005-08-29).
I figure that dirty URLs for lists are pretty non-essential since it is really your permlink article content that content-savvy search engines are after. I would be interested in hearing arguments to the contrary.
I created this mod because rss_suparchive wasn’t working very well with TXP 4.0.1
If someone else can benefit from this mod, fire me an email.
Matt
Offline
Re: Archives
Heck yes! Is there an alternative php file I can download or do I have to re-create the hack myself?
Yes, I have tried turning it off and on.
Offline
Re: Archives
would this work without the section in the url? I have
<code><txp:article_custom limit=“16” dateaware=“1” />
</code>
in my default template and
<code><a href=”/?date=2005-07”>July 2005</a>
</code>
at the bottom of my navbar on this page. It produces the correct URL, but the page loads exactly like the home page (it with today’s articles). Anything obvious I’m missing?
In particular, is there a telltale thing I can look for in the uploaded version of publish.php to make sure that the patched version has uploaded properly?
Last edited by alesh (2005-10-02 15:59:49)
Yes, I have tried turning it off and on.
Offline
Re: Archives
oops . . . right, that doesn’t work: i can’t have article_custom on my home page. SOO… i’ve got a section “archive” that now contains
<code><txp:article_custom limit=“16” dateaware=“1” /
</code>
and my navbar link is
<code><a href=”/archive/?date=2005-07”>July 2005</a>
</code>
I must just not be smart enough for this.
Yes, I have tried turning it off and on.
Offline
#36 2005-10-02 18:15:44
- aesop1
- Archived Plugin Author
- Registered: 2004-09-19
- Posts: 142
Re: Archives
Hmm. Look for the “dateaware” attribute in your uploaded “publish.php” If it’s not there (in the doArticles function), then you have the wrong version. Make sure your publish.php is taking the place of the old one (usually in the root of the “textpattern” folder).
Why can’t you have article_custom on your home page? There is one drawback to using article_custom: it can’t be used with listing paging links (newer and older); ideally, this should work with the txp:article tag, but it doesn’t.
Remember also to make sure your section (presentation > section) references the correct page where you are using the dateaware attribute.
Be happy to look at your page code, if necessary.
SEE POST BELOW . . .
Last edited by aesop1 (2005-10-03 10:12:35)
Offline
#37 2005-10-03 10:13:09
- aesop1
- Archived Plugin Author
- Registered: 2004-09-19
- Posts: 142
Re: Archives
YOU CAN ACHIEVE DATE-AWARE ARCHIVES BY JUST USING THE ARTICLE TAG AND ATTACHING ?month=yyyy-mm-dd AS A QUERY STRING TO YOUR URLS. THE ONLY OTHER “FIX” THAT IS NEEDED IS TO HAVE THE MONTH VARIABLE ADDED TO THE “OLDER” AND “NEWER” PAGING FUNCTIONS SO THAT YOU CAN PAGE THROUGH THE REQUESTED DATE-BASED ARCHIVE. I WILL SUGGEST THAT THE TXP DEVELOPERS DO THIS. UNTIL THEN, YOU CAN REPLACE THE FOLLOWING LINE IN BOTH THE “NEWER” AND “OLDER” FUNCTIONS IN TAGHANDLERS.PHP:
<code>
$url = pagelinkurl(array(‘pg’ => $nextpg, ‘s’ => $pretext[‘s’], ‘c’ => $pretext[‘c’], ‘q’ => $pretext[‘q’], ‘a’ => $pretext[‘a’], ‘month’ => @$pretext[‘month’]));
</code>
AS ALWAYS, MAKE MODS TO THE CODE AT YOUR OWN RISK! SAVE A COPY OF YOUR ORIGINAL TAGHANDLERS.PHP PAGE IN CASE YOU NEED TO ROLL BACK THE MODIFICATION.
Last edited by aesop1 (2005-10-18 05:52:56)
Offline
Re: Archives
Sure enough; ?month=yyyy-mm works great, and i’ve implemented it on my site.
Unfortounately, the page 2 hack doesn’t seem to work. I had not problem finding the two instances to change in the PHP, but it still feeds back a url with only the page2 string. At least I know what’s supposed to happen now; it works fine for the category links but not for the date links (check it on my site).
I can workaround this by having the archive pages use a section where article limit=“99”, so a second page is never required; that may be the prefered behavior. Still, if you can put this last piece into place it would be very impressive.
Archives by date, yay!
Now to switch to feature-request mode, the only thing i personally would need now for my dream version of this is for the links to create themselves, and with the number of posts in parenthesees with the link; same way suparchive_menu used to work.
Yes, I have tried turning it off and on.
Offline
Re: Archives
I’ve actually always pondered this general topic on my own. I wanted to do a little research as to whether people actually did use date-based archives if they didn’t have to. I made a blog/site for a music venue that responds to shows via the blog, adding pictures, telling stories and some other stuff. I think that in this sense, it may actually work to be date-based (since we forced them to set their post dates to the date of the show). That way when someone logs on and they know what date the show was, they could click that date and find 2 or 3 posts from different site admins and see what they had to say/show.
But I haven’t found another context in which date-based archives for a blog are really that necessary. If I go to a blog and want to look back in the archives, I generally remember the context of the article, not the date. This information prompts me to either browse through categorical navigation or use the search (if their archive sucks).
It seems like everyone who starts a new blog always wants that cool little calendar up on the top right or top left. They don’t seem to understand the simple fact that it is a waste of their time, resources and space. It’s also just bad information architecture, in my view. Links should almost always go from broad to specific in a topical sense. If this were the case, search engines would be helped out a bit and visitors would be able to figure out where to go when they receive a 404 error and it just looks and feels so much more right than using a date in the URL.
Offline
Re: Archives
Here we go again with “no, actually, you don’t need that feature you say you need.”
I’ll say it again: archives by category are great for some sites (for example, web design geek sites, where most of the posts contain information on broad subjects), while archives by date are better for others (sites like boingboing, which are primarily entertainment, and benefit from being read in order). The two approaches also appeal to different types of readers.
Interesting that paul has two different archives by date on his site (one of which is broken). If you don’t want to help, fine. But don’t tell me a date archive isn’t necessary just because you don’t find it useful.
Yes, I have tried turning it off and on.
Offline
#41 2005-10-15 18:51:04
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Archives
This is why we have plugins: to supply features that won’t be used by the large majority of users.
The “poo-poo”-ers need to understand: you’ve made a feature request here, not a “how do I”, nor a plugin request. This means its up for discussion, so you can’t very well be upset that we’re discussing it.
As an aside: stop viewing Textpattern as “a competitor”, that’s what causes feature bloat. Textpattern, WordPress, they stand on their own, with their own unique abilities. If they both worked identically, what would be the point of being separate projects?
That’s not to say a feature like this will never exist, or that you don’t need it for your particular uses, simply that if you want it as a feature, as opposed to a plugin, you need to make a better argument for it.
That all said, I’ve been thinking about making such a plugin, since there are not yet many plugin options available. Take this as a discussion to the plugin forum. The bunch of you who want this, get together and decide just how you want it to work. If you can come up with a list of features it really helps: I nor anyone else can make a plugin from thin air. Thus far, almost 100% of the ones I’ve made were because they were a feature I was after, so I knew exactly how it needed to work.
Offline
#42 2005-10-17 23:47:25
- aesop1
- Archived Plugin Author
- Registered: 2004-09-19
- Posts: 142
Re: Archives
Thanks for the response, Mary. What continues to puzzle me, however, is that we are SO CLOSE to having a modicum of date-based archive support with TXP AS IT IS NOW in the release version—would it be that hard to add PAGING SUPPORT?
It is true that we lack tags for creating different date-based menus to interact with the date-based support (month var) already extant within TXP, and that would be an ideal use for plugins. Something along the lines of <code><txp:ini_date_aware mode=“year” section=“blah” prelabel=“Articles from year:” /></code> I’ve also thought about creating a plugin along these lines, but I’ve also thought about cleaning my rain gutters and neither project has been started yet. Rob Sable’s plugin — rss_suparchivebycat — used to work for this but isn’t working since TXP 4.0.
But menu-generation code is an added feature; adding paging support for TXP’s existing month var IS JUST COMPLETING UNFINISHED WORK. I can now sort my archives as mentioned above by using the month var (by year, month or day), and we can create links manually to this end like: <code><a href=“section?month=2004”>Articles from 2004</a></code>. It would simply be nice to be able to page those results.
Regarding the “feature request” vs. “how do I” thread argument: okay the “legal” point is given that this is the wrong forum thread for this discussion, but that still doesn’t invalidate Alesh’s argument, nor the fact that date-based archives are a familiar staple of web sites and can be immensely useful for events and news release sections on sites spanning several months or years. This is really standard CMS functionality.
I recall several months ago that Alex (zem) responded to someone criticizing him for adding “sticky articles” as an added feature before TXP was released and said:
“I had a complete, clean and tested patch sitting on my desk. It solves a problem that causes frequent support questions and requires complex workarounds. Big win, minimal cost.”
My question to the TXP development team is: “Can we have such a big win now with minimal cost for basic date-based archives?”
P.S. Alesh: I’m puzzled that the paging hack doesn’t work on your end. I’ll see if I can get it working on mine with a fresh install.
Last edited by aesop1 (2005-10-18 00:27:23)
Offline
Re: Archives
Interesting that paul has two different archives by date on his site (one of which is broken). If you don’t want to help, fine. But don’t tell me a date archive isn’t necessary just because you don’t find it useful.
Actually that’s on my blog and my blog is entirely experimental. There is really only one date-based archive and it doesn’t work because rss_suparchive seems to be very borked on my site since the addition of 404 errors (which I’m really angry about how this was done…).
Offline
#44 2005-10-18 05:44:23
- aesop1
- Archived Plugin Author
- Registered: 2004-09-19
- Posts: 142
Re: Archives
One thing that I would like to add to my long-winded post above is that I really love TXP and think that Alex, Sencer, Pedro, Dean and great plugin writers like Mary are doing a terrific job. I just think that this date-based archive thing is a bit of an oversight (probably because of the blogging roots of the app). Get the date-based thing taken care of (and maybe add a multiple category article tag) and we have a highly configurable, easy-to-use CMS that can be used for various kinds of sites.
If adding paging support for the month var in TXP is programmatically difficult, dangerous, or rightout foolhardy, just tell me and I’ll shut up. But keep in mind that this is a friendly query and that we just want to see TXP be the best it can be.
Last edited by aesop1 (2005-10-18 05:45:04)
Offline
Re: Archives
> paularms wrote:
> There is really only one date-based archive and it doesn’t work because rss_suparchive seems to be very borked on my site since the addition of 404 errors
> mary wrote:
> That all said, I’ve been thinking about making such a plugin, since there are not yet many plugin options available. Take this as a discussion to the plugin forum. The bunch of you who want this, get together and decide just how you want it to work. If you can come up with a list of features it really helps: I nor anyone else can make a plugin from thin air. Thus far, almost 100% of the ones I’ve made were because they were a feature I was after, so I knew exactly how it needed to work.
> wilshire wrote:
> Keep in mind that a lot of changes have taken place in the Textpattern code since this plugin was last released. Things that used to work might not anymore. I started to work on updating the plugin but am up to my neck in work at the moment. I’ll take a look at these problems when things quiet down a bit.
It seems like some of us are getting overwrought more than necessary. While I would love to see native support for date-based archives, I don’t expect to see it for a while. The simplest way to resolve this is for either wilshire to fix the rss_suparchive plugin or for the rest of us to do it for him. When I have some time later today, I am going to give it a shot.
Offline