Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
hard-code a date string into a nav link?
Hi all, I am trying to figure out how to link to an archive by month.
I’ve tried every date archive plugin i could find and they either did not do what I need, or they just plain did not work. So, I am trying to figure out how to do this within Txp’s existing tags. Note I am also not able to upgrade to 4.0.4 because one single plugin that I absolutely must have does not work in 4.0.4, so I am working with 4.0.3.
If there is some way i can hard-code the navigation links that would solve my problem, but I don’t know how Textpattern recognizes dates. So, I’m thinking something like this might work:
<code>href=archives/?d=/5/2007</code>
I just need to know the proper syntax, if that is in fact possible.
Thanks in advance.
-Paula
Oh PS… I am also using clean URLs.
Last edited by Locutionist (2007-05-30 00:30:01)
Offline
#2 2007-05-30 00:45:53
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: hard-code a date string into a nav link?
You mean like this?
<ul>
<txp:article form="month_archive_link" />
</ul>
<txp:if_different> <li><a href="<txp:site_url />archives?month=<txp:posted format="%m/%Y" />"><txp:posted format="%m/%Y" /></a></li></txp:if_different>
Offline
Re: hard-code a date string into a nav link?
yes, I got that far, but now I want to break up the nav to link to the individual months that appear on that very archive page.
This is for a photoblog, so the archive page will be displaying thumbnails. I don’t want people to have to wait for more than 31 thumbnails to load.
Thx, -Paula
Offline
#4 2007-05-30 02:03:40
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: hard-code a date string into a nav link?
Can you elaborate?
Offline
Re: hard-code a date string into a nav link?
maybe something like chs_ifurlvar would do the trick. See this thread for a similar example. You could pass the variabl with the link according to month, then use chs_ifurlvar to read in the value from the link and pass it to txp:article(_custom)’s month="yyyy-mm"
attribute. BTW: I imagine using slashes in the date ?d=/5/2007
would cause difficulties, try instead ?d=2007-05
. You might also need asy_wondertag to nest txp functions inside each other.
TXP Builders – finely-crafted code, design and txp
Offline