> the problem was really the systemConfig tag. After de-tagging everything is
> fine. Is this explained somewhere in the docs? I totally missed it :(
> And I also came to a conclusion that SystemSettings is saving the state of
> the TW, not forces it. So for those cases I will use the trick okido points
> to.
option values are initialized from 4 possible sources, in this order:
1) TW core (hard-coded)
2) cookie value (browser)
3) SystemSettings (tiddler)
4) plugins (tiddlers)
Some plugins use syntax like:
config.options.txtSomePluginOption="somedefaultvalue";
to *hard-code* their default option values. Note: you can assign a
custom value that *overrides* a hard-coded plugin value by creating a
separate "configuration plugin" tiddler, tagged with systemConfig,
that has the re-defined initialization:
config.options.txtSomePluginOption="customdefaultvalue";
Because plugins are processed in alphabetic order by title, the
configuration plugin is traditionally named something like
[[zzConfigSettings]]. The "zz" prefix in the title ensures that it is
the last plugin processed during startup.
Note: while option values may be changed during a TiddlyWiki session,
this type of initialization *ignores* values from steps 1-3, and
always applies the plugin-based settings, even if browser-based cookie
values are available. This effectively turns all option settings into
'session-only' values... reloading the document returns all settings
to their previous, fixed values.
Fortunately, some plugins use a more flexible, conditional approach to
initialization so that values retrieved during steps 1-3 can still be
used, with a *fallback* to the hard-coded value only if no other value
has been defined:
if (config.options.txtSomePluginOption===undefined)
config.options.txtSomePluginOption="somedefaultvalue";
In in addition to allowing cross-session cookie-based options to be
used, this approach to initialization has the advantage of allowing
you to use *any* name for your custom "configuration" tiddler, rather
than forcing you to use the "zz" prefix to control the order of
processing.
Unfortunately, it's important to note that this approach still does
not permit complete portability of settings, as it relies upon browser-
based cookies to hold any non-default persistent values, rather than
storing them in the document, so that they can be applied regardless
of the browser you are using or the storage location of the document.
One way to address this, and achieve truly portable, document-based
settings, is to use
http://www.TiddlyTools.com/#CookieSaverPlugin
Whenever a TiddlyWiki option setting changes, the plugin automatically
stores the value in a systemConfig-tagged tiddler named [[CookieJar]],
containing generated javascript assignment statements using the same
syntax as the 'traditional' zzConfigSettings tiddler (e.g.:
config.options.someTiddler="somevalue";
Because the CookieJar is processed as a plugin, the values stored in
the CookieJar are applied during the normal startup processing.
However, unlike a hand-maintained zzConfigSettings tiddler, the
CookieJar values always reflect the most recent activities. Note: As
with the zzConfigSettings method, you can control the order in which
the CookieJar is processed during startup by adding a prefix to it's
title. You can use a prefix of "." to ensure that the CookieJar is
processed *before* all other plugins, or use a prefix of "_" (or "zz")
to ensure that the CookieJar is processed *after* all other plugins.
Note: you will also need to add the following line (to the .CookieJar)
config.options.txtCookieJar=".CookieJar";
so that the CookieSaverPlugin can still find and automatically update
the renamed tiddler.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios