Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-04 11:06:05

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

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.


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

#2 2008-01-04 11:31:36

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#3 2008-01-04 13:43:08

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#5 2008-01-04 14:55:47

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

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

#6 2008-01-04 15:01:02

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

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

#7 2008-01-04 16:38:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

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

#8 2008-01-04 19:54:20

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

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)


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

#9 2014-01-27 08:22:53

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

Board footer

Powered by FluxBB