0

Would really appreciate help resolving this. I am using D7 and the devel module is not an option, for some reason it causes some problems with my site. I have looked into the contemplate module but see it isn't supported in D7, otherwise it would be great. Is there any quick way for me to see all my variables so I can utilize them in a preprocess function?

2
  • I would look into why the devel module is not working on your site. If devel isn't working, you may experience other problems as well. May 7, 2012 at 14:41
  • have not experienced any other problems, for some reason devel didnt work from a new install. Might be some php settings on the server, don't know. I am looking for another way
    – A_funs
    May 7, 2012 at 14:45

2 Answers 2

3

Yes, you can do something like this in a custom module:

function YOURMODULE_preprocess_node(&$vars) {
  drupal_set_message('<pre>' . print_r($vars, true) . '</pre>');
}

or this in your theme's template.php file:

function YOURTHEME_preprocess_node(&$vars) {
  drupal_set_message('<pre>' . print_r($vars, true) . '</pre>');
}

If that's too much information, you can get just the variable names with:

 foreach ($vars as $name => $value) {
   drupal_set_message($name);
 }

instead of print_r()ing the entire array.

0
2

I use Drupal for Firebug module and respective extension for firefox. With these modules yo can call firep() function:

function YOURTHEME_preprocess_node(&$vars) {
  firep($vars);
}

to see result in firebug console (in a special 'drupal' tab).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.