For my first ExpressionEngine project I’ve found the documentation and this forum to be very helpful and working with EE has been a blast so far, but I’ve now run into something I can’t quite figure out:
I’m looking to create a list of entries that is dynamically filterable and sortable, as is done in the documentation here. But I’m looking to make one selectbox (dropdown) which handles both the field that is used for sorting as well as the direction of the sorting, at the same time. It would have options like “cheapest first” (sort by price, descending) and “newest first” (sort by date, descending), “sort by brand” (ascending, alphabetically) and a few more. Since the options in the dropdown can only refer to one dynamic parameter at the same time, how would I go about setting this up? Would I need to set hidden input fields using javascript when the selectbox is changed, or is there a more elegant solution?
Edit: Seems like I may have overestimated the power of the channel entries tag. As cool as it is, there’s a few features I need that most likely cannot be achieved with dynamic parameters alone. Namely the feature mentioned above, as well as filtering by a price range (min - max). I’m now thinking the query module might be able to help me here, but the examples in the documentation are a little basic compared to what I’m trying to achieve. Seems like I need the exp_channel_titles and exp_channel_data tables, and put my filters in the WHERE part of the query. An example of something like this would be very much appreciated.