User login

variables

Quickly find a Drupal variable to embed in code

If Features and Strongarm are installed, you can use them to get the variable name even if you won't be overriding the variable in the Strongarm style.

drush fe | grep variable

The above shows all variables.

Alternatively, use the below to search for any fragment of the variable name you think you remember.

drush fe | grep keyword

Gotcha: The variable will only be listed if you have saved it in the user interface!

A new Settings API for Drupal

Update, there is an active real project doing much of this: http://drupal.org/project/variable

This is primarily a matter of deployment and developer sanity, but it is also a performance issue: large variables that aren't used on most pages shouldn't be loaded on every page.

The variable table has to change, and we need to distinguish variables that are needed on (most) every page load from those that clearly are not.

Strongarm usage notes

Strongarm does not have its own administration page (that does anything). Add variables to your export by going to the Features administration page.

Background

http://developmentseed.org/blog/2009/dec/04/strongarm-2-leaner-and-meaner

Convert an associative array to variables with the names of the keys and the matching values

php turn an array into variables matching keys
php associative array to variables

The function you want is

<?php
 extract($array);
?>

http://us.php.net/extract

You can also do it the hard way.

Syndicate content