Community

Drupal 7 / Views 3 / order specific to filtered term id?

Hi

I have a content type: 'venue'
a taxonomy vocabulary: 'event type' with 13 terms in it.

A 'venue' can have 1 or more 'event type' terms associated.

I can build a view that can show the 'venues' that match the selected: 'event type'

Now the client is looking to order the output depending on the filter used.

So, we have venue content: 'venue 1', 'venue 2' and 'venue 3'.
Each venue has both the taxonomy terms.: 'event type 1', 'event type 2'

If the filter is set to 'event type 1' the venues will be ordered
'venue 1'
'venue 2'
'venue 3'

If the filter is set to 'event type 2' the venues will be ordered
'venue 2'
'venue 1'
'venue 3'

How would I go about setting this up, in a way that is easy to manage for the cms administrator?

Thank you for your help
ice70

Comments

I'm not sure if there is a

I'm not sure if there is a point-and-click way to do this, but you can add a sort programmatically using custom code in a hook_views_query_alter().

Thank you Corey... looks like

Thank you Corey... looks like its going to be some kind of hard coded switch fun :s

Thank you for your help,
ice70