Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-02-20 17:42:11

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: user controlled article sorting

NM, another bone-headed mistake on my part. I just needed to put two select elements in the same form rather than in separate forms, using the same above format. With my if_variable tags in the option elements, existing filters are already selected when you go to change another one, so all values are submitted whenever you change a single value from any of the drop down boxes. I might post this method to Txp Tips if I get a chance.

Last edited by aswihart (2010-02-20 23:46:49)

Offline

#14 2010-02-20 18:16:17

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

Re: user controlled article sorting

I guess if you generated your list of options automatically rather than hard-coding, e.g. from a list of categories, then you would only need one if_variable to apply the relevant selected. It’s a bit more complex to auto-generate the option list with custom fields: you need article_custom with if_different and your relevant custom_field to retrieve all the values of that custom field just once and then an if_variable to compare the custom field value against the variable from the url.

Another possibility might be give your options classes, then use jquery to attach “selected” to the select-option that corresponds to the GET urlvar. There are plenty of examples if you google.


TXP Builders – finely-crafted code, design and txp

Offline

#15 2010-02-20 18:35:08

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: user controlled article sorting

Hehe, of course, if you can imagine it, you can Google how to do it. Thanks for the thoughtful suggestions jakob, I guess I will stick with the proven hard-coding solution, which is fine as I’ve already done the work.

Offline

#16 2010-02-20 20:06:21

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: user controlled article sorting

For those interested, I’ve posted my method for filtering articles using custom field drop-down select menus on Txp Tips and in the How To’s section of this forum.

Last edited by aswihart (2010-02-21 18:09:25)

Offline

#17 2010-09-30 02:36:21

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: user controlled article sorting

jakob wrote:

It’s a bit more complex to auto-generate the option list with custom fields …

Have a look at esq_glzcfvallist.

Offline

Board footer

Powered by FluxBB