I'm using the query module to return entries for a particular page. I would like to create a drop down list where the user can change how the entries on those pages are sorted.

is it possible to use something like Mo' Variables to add something in the URL string that I can pick up and use in my query to change my sort on page refresh?



I think I'm reaching for straws, so need some good guidance.


sure, that is doable. set your template to read php on input. then in your query do

ORDER BY <?php echo ee()->input->get('sort'); ?>

or something like that

  • The "native" EE method would be using url segments like {segment_4}, of course ...
    – Ingmar
    Dec 8 '15 at 10:03
  • Mo' Variables also has variables set for GET parameters, so you could use those instead of using PHP in the template. Jan 8 '16 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.