Question: I'm building one village's official site in Drupal 7. I need to create and store some information about village that will be accessible everywhere on the website (e.g. village's name, mayor's name, phone number, email, etc.). I want to define them in the admin site and access them in any node (e.g. all the data will be shown in the section about municipal office and some of them like phone number mentioned in the contact section. What is the best way to do that? Is there some module to handle that? Or should I write the own one? I have tried to search the answer there, but I found only topics about global variables (in PHP).

Answer: 
You can use the functions [variable\_get()](http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/variable_get/7) and [variable\_set()](http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/variable_set/7) to store arbitrary information that is available on all pages. It is easy to write a form that automatically saves all form fields with variable\_set(), see <http://drupal.org/node/222158>.

Note:
- Saving variables with variable\_set() will clear the cache of all variables, you should not use it for information that changes regularly.
- All variables are cached in a single, global cached and fetched on every single page request. You shouldn't store large amounts of data or data that is only used very seldomly.
You could also consider [Creating advanced theme settings](https://www.drupal.org/node/177868).

See how you can specify the site's logo path in your theme? You could do something similar with the info you would like to display on your site, practically setting up your theme as a template for a village website.

You get to add custom fields in your theme admin settings, field values can then be retrieved by using [theme\_get\_setting()](https://api.drupal.org/api/drupal/includes!theme.inc/function/theme_get_setting/7)