You are here

Blog

Drupal 6.x - Display argument in views header

<?php
$view
= views_get_current_view();
print (
str_replace("-"," ",$view->args[0]));
?>

the 0 is for the first argument, which in this case happens to be a page title that is formatted with dashes to be used in the path. So i used str_replace to take out the dashes.

this is also a very useful bit of code to view the available fields:

<?php
 
drupal_set_message
('<pre>'.print_r($fields, TRUE) .'</pre>');
?>

I adapted this to view the available arguments:

<?php
drupal_set_message
('<pre>'.print_r($view->args, TRUE) .'</pre>');
?>
Drupal
Views

Need A Developer? Contact Us