different sort criteria depending on term ID I'm using views for my taxonomy term page. I want to sort the nodes in some categories by title, while nodes in other categories by weight. I've been poking around the views UI but I can't figure it out. I was thinking that I probably should implement some hook or create a custom query but I don't know where to start. How do I achieve this?
I accomplished what I wanted to do by using hook_views_pre_build() and hook_views_query_alter()

 /* Remove sorting by weight if viewing a category that should be alphabetized.*/
 function commerce_customizations_views_pre_build(&amp;$view) {
   $alphabetize = array('3','58');

   if($view-&gt;name == 'taxonomy_term' &amp;&amp; $view-&gt;current_display == 'page'
   &amp;&amp; in_array($view-&gt;args[0], $alphabetize)) { 
    unset($view-&gt;sort['weight']);
   }
 }

 /* Sort by title if viewing a category that should be alphabetized.*/  
 function commerce_customizations_views_query_alter(&amp;$view, &amp;$query) {
   $alphabetize = array('3','58');

   if($view-&gt;name == 'taxonomy_term' &amp;&amp; $view-&gt;current_display == 'page'
      &amp;&amp; in_array($view-&gt;args[0], $alphabetize)) {
        $query-&gt;add_orderby('node','title','ASC');
   }
 }