Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How do I create archives with different outputs on the same page?
What I’d like to be able to do is display archives by:
Category
Title
Rating (uses custom field)
User visits the archive page and can select a link or drop down menu to filter archive output as above. So the output would be:
A
Article 1
Z
Article 2
Cat 1
Article 1
Cat 2
Article 2
Rating x
Article 1
Rating y
Article 2
I think I have the category sussed thanks to Stu, but not sure how or whether there is a way to output articles with an a-z link list and with regards to the custom field
thanks in advance
Offline
Re: How do I create archives with different outputs on the same page?
For the A~Z list, I think you’ll need some PHP/SQL to do it. Basically you want to trim the title to its first letter, and apply a txp:if_different
statement to it.
Offline
Re: How do I create archives with different outputs on the same page?
you might find this thread useful – it uses chs_if_urlvar to ask to do a particular action (in this case sort according to different methods) using the same template and a variable added to the URL.
The same principle may work with cookie-detection instead of the urlvar method now that chs_cookie has also been released. I’ve not tried it yet but I imagine a cookie allows the preferred sort method to be saved on a per-user (i.e. per cookie) basis.
TXP Builders – finely-crafted code, design and txp
Offline