Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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