Question

I have a filter on a CCK field called "Region", I have exposed it with a drop down box

What I want to happen is to use this as an "Order By" functionality, so that if the user selects a region, it will order the output with the selected region showing first.

This is so that if there is no content in a given region, it will at least display content from the other regions.

Était-ce utile?

La solution

You can't do this using the views interface. It's currently only possible to expose filters to users, not the sorting. So it's possible only to show nodes with a specific reason that the user choose, but not sort it.

You can create this functionality in a custom module using hook_views_query_alter. But it would require some php coding and would probably be a bit tricky to get right.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top