Hi there,

You can find my question a little strange, but I would like to find a list of drupal variable. I explain :

I'm developping a theme for drupal5 based on bluemarine theme.

I see in the template file that there are several variable like $node_url, $content, $picture etc....

I don't know if there are other variable like that to have more possibilities to manipulate drupal without add php function which could already exist.

Where can I find a kind of list of variable, to see all the possibilities of this CMS.

Thanks,

zmove

Comments

zzJames’s picture

the drupal variables are numerous depending on whether for example you are using views, CCK, or any custom module. When using PHP template you are just using PHP as normal, it's like using an integrated development environment where the code you are developing is the same code the IDE is written in.

The basic install drupal code has many many variables at different levels of scope, in different arrays and objects. too many to mention.

but a guide to theming is available here:
http://drupal.org/phptemplate

and a guide to the drupal code can be found here, search for a function of interest and navigate from there.
http://api.drupal.org

HTH

zz_james

dman’s picture

list of page.tpl phptemplate variables
There are more that relate to specific sub-templates - like node.tpl etc

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

zzJames’s picture

put the line

print_r($variables);

in any xx.tpl.php file

where xx is something like node

kingandy’s picture

Is there anywhere - or any way - I can look up the basic site-configurable variables available through variable_get()? The API entry on the function is pretty basic ("Return a persistent variable").

I just want to use the sitewide email address in a mail function...

EDIT: Oh, I figured it out ... by viewing the page source for the config page (variable_get('site_mail','')). I'm still interested in knowing if there's a core variable reference anywhere, though. There should be an easier way to find out that sort of thing than by loading it into your browser and viewing the source...

++Andy
Developing Drupal websites for Livelink New Media since 2008

dman’s picture

Site config variables are different from the page-specific variables discussed here. Each module has the ability to make up its own as needed, so there's no static canonical list.

But if you as a developer want to see those ones (and you don't want to look at the 'variables' list in the database table called 'variables') you can also get them with one click using the devel.module.

It does a handy dump for you.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

anisur_rahman’s picture