1

I searched far and wide to find a working solution to this but couldn't find it.

What I want to do is change the argument that is passed to the view because I want for pathauto cleaned taxonomy terms to work as an argument. I have a code that transforms cleaned term back to a original one, but cannot make the view use it.

I saw some people changing it in hook_preprocess_views_view(&$vars) but in my case (Views 2.11) has a argument in $vars instanced so many times that it's not the way.

Can anyone please help me change this argument?

Owen Blacker
  • 4,117
  • 2
  • 33
  • 70
Blaze
  • 11
  • 2

3 Answers3

0

There may be a better way but you could use views_embed_view() and set the arguments yourself

Jeremy French
  • 11,707
  • 6
  • 46
  • 71
0

I think hook_views_pre_view might help you do just that.

Jigarius
  • 394
  • 3
  • 16
0

I have two ideas, either to add some custom php code to the view's argument's phpcode section that does something like this

$args[0] = 1;
return $args;

or try to use the function

hook_views_pre_view(&$view, &$display_id, &$args) {
  // modify $args value here
}

didn't test them so don't know which will work.

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
frazras
  • 5,928
  • 4
  • 30
  • 40