According to the Drupal documentation, the variable $theme contains the name of the active theme (see http://api.drupal.org/api/global/theme/6).

For some reason, I cannot use this variable in my module. echo $theme; prints nothing.

I know I didn't overwrite the variable. Could I be doing anything wrong, or did I run into a bug?

Comments

zeta ζ’s picture

Did you use the code given in the page that you linked to?

 global $theme;
...
echo $theme; 

___________________
It’s in the detaιls…

demonstration portfolio

john.karahalis’s picture

I tried using it as a global variable also, but that didn't work either.

zeta ζ’s picture

global $theme;

print '<pre style="color: red;">&laquo;' . print_r($theme, true) . '&raquo;</pre>'; 

___________________
It’s in the detaιls…

demonstration portfolio

john.karahalis’s picture

I just see the characters in red. The actual HTML that is output is the following:
<pre style="color: red;">&laquo;&raquo;</pre>

If I eliminate the second parameter from print_r(), I get the following HTML:
<pre style="color: red;">&laquo;1&raquo;</pre>