arguments

view arguments exposed links

  1. /**
  2.  * Implementation of hook_views_pre_render.
  3.  */
  4. function views_arg_list_views_pre_render(&$view) {
  5.  
  6.   // check this is calendar view, showing a page
  7.   if ($view->name == 'calendar_combined'

Code

  1. In the header of my view (using php input format):
  2.  
  3. <?php
  4. $view=views_get_current_view();
  5. print_r($view->args);
  6. print "\n";
  7. print "name: ".$view->name;
  8. print "\n";

Fix for Argument handling code for a view taking in TID as argument, trying to get the parent TID to be returned (if it has)

  1. // note that this only gets the immediate parent
  2. if ($args[0]){
  3.         $parents = taxonomy_get_parents($args[0]);
  4.         if ($parents) {
  5.                 foreach ($parents as $parent) {
  6.                 $parentID = $parent->tid;

Argument handling code for a view taking in TID as argument, trying to get the parent TID to be returned (if it has)

  1. if (taxonomy_get_parents($args[0])) {
  2.   $args[0] = taxonomy_get_parents($args[0]);
  3. }
  4. return $args;
Syndicate content