I have a view called "choice" which works with an argument (see choice_view.jpg) used like :
http://mywebsite/choice/16/music for example
In this view I have an exposed filter and I want to remove some values. I try the following code in template.php which works only in http://mywebsite/choice. How can I do to make it works with argument ? (i suppose argument is the problem, but not i'm sure)
function phptemplate_views_display_filters_choice($view){
$form = drupal_retrieve_form('views_filters',$view);
$view = $form['view']['#value'];
$options = $form['filter0']['#options'];
$filters = $view->filter[1];
foreach($options as $option=>$value){
if(in_array($option, array('1','2','3'))){
unset($options[$option]);
}
}
$form['filter0']['#options'] = $options;
drupal_process_form('views_filters',$form);
return drupal_render_form('views_filters',$form);
}
| Comment | File | Size | Author |
|---|---|---|---|
| choice_view.JPG | 57.7 KB | Nicolas_85 |
Comments
Comment #1
Nicolas_85 commented