Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Have user select the sort method to display a list
‘Scuse me if I don’t explain this very well technically…
I want users to be able to click on a link or button on a page that will determine the order that a list of articles displays in.
The options would be something like ‘date’, ‘speaker’, ‘series’ – all information that is contained in separate custom fields with each article.
Matthew Smith has implemented something like this here – but I’m not even sure if that is a TxP site. Does he simply load a different page? I find it hard to tell..
But surely, there is a better way to achieve the desired result than just loading a separate page?
I would guess that js could be used, but I don’t have a clue how. ;-)
I should be able to figure out the conditional logic for TxP to display the list uses different forms – if I have a variable of some kind to test for.
Could a simple form consisting of radio buttons (using Zem Contact) be used?
Any kind person willing to help achieve this (in very small steps, please!)?
Many thanks.
Offline
Re: Have user select the sort method to display a list
I did write little article about this couple of months ago. Uproar n Rattle > Journal > Allow user to sort articles differently
I hope it helps. And ofcorse you can parse it with Ajax if you want, so no real pageload is required.
Cheers!
Offline
Re: Have user select the sort method to display a list
And if my memory serves me correctly Neil that site is EE
.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#4 2008-01-04 14:29:00
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: Have user select the sort method to display a list
Neil
This might not be exactly what you’re looking for but I think Nathan Smith did some sortable stuff on his archive page. He wrote about how he did it.
— Steve
Offline
Re: Have user select the sort method to display a list
I’ve used chs_ifurlvar as described in this thread before to achieve this. Jukka’s approach is essentially a streamlined version of this with direkt php instead of a plug-in for specifically that purpose.
You could use Rewrite rules in your .htaccess to achieve the kind of url’s matthew has used in his page linked earlier.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Have user select the sort method to display a list
you can check out this article by kevin potts
heres the example sorting page in use
Last edited by iblastoff (2008-01-04 15:02:22)
Offline
Re: Have user select the sort method to display a list
Depending on the level of complexity you’re after it might even be possible with some jQuery magic?
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
Re: Have user select the sort method to display a list
Thanks so much people! Great to wake up this morning to so many helpful suggestions!
Will work my way through them and then probably ask lots more questions.
Really appreciate the help…
Update:
Worked through all the suggestions (or at lest the ones I could understand – don’t really have a clue about implementing js).
Jukka: Thought I had what I needed with your solution (an thanks for the that article), but I wanted to avoid putting raw php on the page if I could.
Looked at chs_if_urlvar but this seems to have problems with TxP 4.05, so then I found Stef’s smd_if plugin and it does exactly what I need.
Thanks again everyone, and especially Stef for that very cool plugin.
Last edited by NeilA (2008-01-04 23:05:38)
Offline
Re: Have user select the sort method to display a list
If someone is still looking for this kind of feature, this tutorial could help.
Offline