Home ›
Use drupal_set_message with print_r to see the view codeUse drupal_set_message with print_r to see the view code
Submitted by Benjamin Melançon on May 6, 2008 - 5:30pm
Moving this tip over from where I posted it at Lullabot in their 50 tiips thread.
Specifically, put this in the custom argument code:
<?php
drupal_set_message('<pre>' . print_r($view, TRUE) . '</pre>');
?>
(PHP tags used for formatting here and are not entered into the argument code textbox.
To do this on a live site without regular folks seeing, while you're online as user #1, you can use this:
<?php
global $user; if ($user->uid==1) drupal_set_message('<pre>' . print_r($view, TRUE) . '</pre>');
?>
(Note: Agaric Design Collective would never, ever, ever do debugging or development on live site. Ever. Anymore.)
Resolution
Searched words:
Print view definition
Comments
-
Good tip, another way is to use dblog eg. watchdog('debug', print_r($view, TRUE));
(BTW This captcha is horrible :D )
Post new comment