Template:Options/doc

A common options mechanism for templates.

Initialization
The configuration of options must be registered before the options can be used. It can be done via options/init, for example(It will be used for all following examples as well):

It is possible to have it load automatically("autoload") via. For example, for, it will try to transclude.

Get/set options
Get: or

Set: or

Note: The latter form is a bit slow, but more handy for writing. For using in templates the former is prefer, and for using in articles both are ok.

Example:

It will output:

Snapshot
It is possible to save current state of options to a snapshot, then restore it later.

Example: It will output:

There is a special snapshot created during initialization, it can be restored via