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.
The answer by Berdir is already very good in case you only want to store the raw data. However, if you always want to display the data in the same way like in some kind of widget format, you have other options, too.

For example, you could create a block with the contact details and you only show it on specific pages.

If you need more flexibility, you might consider to write a small module with different theming functions. You would either store the data directly in the module or in the variable table as outlined by Berdir.

In any case, if you want to allow the user to change this data on his own, you will probably need to write a small form in the backend. Otherwise, the user will need to manipulate the database directly to change the data.