Setting up GeeVar requires the creation of a new custom weblog field group and a new weblog.
Creating variables is as easy as creating a new weblog entry. Simply choose the weblog you created from the Publish menu in the control panel.
Variable Name. The url title is used as the variable's name in the templates, so give the variable a title that makes sense. Something like "Company Address" or "Homepage Welcome Message", which become myprefix_company_address and myprefix_homepage_welcome_message.
Variable Value. Enter the variable's value in the custom field you created. Set the field formatting as appropriate.
GeeVar allows you to nest variables. For example, you could have a "world" variable with the value "World", and a "hello_world" variable with the value "Hello {geevar_world}!". The output would be "Hello World!". There are checks in place to help prevent infinite recursion.
Using GeeVar in the templates is as simple as wrapping {exp:geevar} tags around the content you want processed.
weblog="global_variables" -- Enter the short name of the custom weblog you created. Required.
var_prefix="geevar_" -- The prefix value you used during the setup process. Default is "geevar_".
The variables are in the format myprefix_variable_name. Using the homepage welcome message example from above, your template might look like:
{exp:geevar weblog="global_variables"}
<p>Here is a hello from our company:</p>
{geevar_homepage_welcome_message}
{/exp:geevar}
A number of "meta" variables are available. They provide information about the Geevar variable. The most commonly used include date variables like entry_date and expiration_date (described below), and status. Meta variables have the format {myprefix_variable_name:date_variable}.
{geevar_homepage_welcome_message:status}
Date variables are in the format {myprefix_variable_name:date_variable format="%Y-%m-%d"}. For example:
{geevar_homepage_welcome_message:entry_date format="%Y-%m-%d"}
Available date variables are: entry_date, expiration_date, and edit_date.
Geevar's variables and meta variables can be used in standard EE conditionals, i.e.
{if geevar_homepage_welcome_message:status == 'open'}Woohoo!{if:else}Boo!{/if}