Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Fetching arrays/queries
So, I’m still busy trying to get an archive up and running on my blog
Now, after lot’s of searching on Textbook + trial/error, I am able to produce following URL’s automatically (with the help of <txp:if_different>
and <txp:posted />
):
http://www.madebyelephant.com/blog/?y=2008&m=01
Is there any way I can catch the array/query (I don’t know how they are called) used in the url? In this case, I can easily display only articles posted in that month of that year…
Another thing: Is there any way to use something similar like <txp:if_search>
for this situation?
Last edited by maxvoltar (2008-01-18 16:48:09)
Textpattern projects: Maxvoltar, Made by Elephant, Twunch
Offline
#2 2008-01-18 17:33:13
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Fetching arrays/queries
maxvoltar wrote:
Is there any way I can catch the array/query (I don’t know how they are called) used in the url?
Try chs_if_urlvar.
Offline
Re: Fetching arrays/queries
Els you’re the best! Will try it tonight!
Edit: I will certainly use this plugin for the <txp:chs_if_urlvar var="get_variable">
-part, but I can’t use it to display the correct articles (because you can’t use a txp
-tag inside another txp
-tag, no?)
How should I do this? PHP? Maybe I can use this script ?
Last edited by maxvoltar (2008-01-18 19:15:55)
Textpattern projects: Maxvoltar, Made by Elephant, Twunch
Offline
Re: Fetching arrays/queries
(because you can’t use a
txp
-tag inside anothertxp
-tag, no?)
Last edited by maverick (2008-01-18 19:55:05)
Offline
Re: Fetching arrays/queries
Ok, finally got the chance to play a bit with these plugins, but there’s a problem:
chs_if_urlvar does not support <txp:else />
, which is a bit of a problem…
This is the final step towards my own self made archive :-)
Textpattern projects: Maxvoltar, Made by Elephant, Twunch
Offline
Re: Fetching arrays/queries
Yes, I found that out too :-(
While I was hacking it to add the ELSE ability I decided to take it a step further. smd_if was born; you’re welcome to try it. If it doesn’t do what you want (it should but I may have missed something) then contact me directly. I may have the hacked version of chs_if_ulrvar I made lying around but it’s unsupported and totally unofficial so you probably won’t get any help from anyone else if it doesn’t work. Not trying to put you off, but caveat utilitor!
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#7 2008-01-20 20:56:28
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: Fetching arrays/queries
gbp_permanent_links alows you to have yyyy/mm urls. The article tag on the page would automatically display the desired articles. And it has all the if tags you’d ever dream of.
You could also use the native ?month=2007-12
in your urls.
Last edited by guiguibonbon (2008-01-20 20:57:47)
Offline
Re: Fetching arrays/queries
@guiguibonbon: Native in gbp_permanent_links or native in Textpattern?
Textpattern projects: Maxvoltar, Made by Elephant, Twunch
Offline
Offline
Pages: 1