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 option/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:

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