1

I have a view that filters nodes by a contextual filter that allows multiple values. So it gets a list of node IDs like 234, 235, 210, 56, 78. Is it possible to sort the result of this view according to the order of the given IDs? I tried to achieve that by deleting all sort criteria, but this leads to an arbitrary order of the results.

2

The Views Arguments Extras module (for Drupal 7) seems to do what you are looking for. According to the module page, it provides the following:

Argument Order Sort

a sort handler, that allows for the order of items to be based on their order in a multi-value argument

This particular component is ported to Drupal 8: Views Argument Order Sort:

Using this module will give you a new sort type with a variety of options where you can choose what field to apply the argument values to for sorting.

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.