Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By zmove on
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
try api.drupal.org
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
Yeah, in the theming guide
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/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Also
put the line
print_r($variables);
in any xx.tpl.php file
where xx is something like node
Hmm
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
easier ways...
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/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
https://www.drupal.org/node
https://www.drupal.org/node/1728148