User login

Use drupal_set_message with print_r to see the view code

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

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.