Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-18 12:05:07

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

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

#2 2006-02-18 12:28:50

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

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

#3 2006-02-18 22:15:41

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,771
Website

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

Board footer

Powered by FluxBB