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);
}

CommentFileSizeAuthor
choice_view.JPG57.7 KBNicolas_85

Comments

Nicolas_85’s picture

Status: Active » Closed (fixed)