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?

share|improve this question
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. – Patrick Kenny May 7 '12 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 '12 at 14:45

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
thanks that works – A_funs May 7 '12 at 17:21

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

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