> Can anyone point me to documentation and/or examples of how to create
> a theme for the switchTheme mechanism built in to recent versions of
> the TW core?
> I'm actually at the moment just trying to have a different
> ViewTemplate for readonly mode, automatically switched. From examining
> the switchTheme code, this seems to be provided for by creating
> ViewTemplateReadOnly, but I tried that and it was not automatically
> switched. I surmise I actually have to create and apply a theme for
> switchTheme to make this work, but I do not know how to do that.
Create a tiddler (e.g., MyTheme), containing this line:
|ViewTemplateReadOnly|ViewTemplateReadOnly|
This defines a "ViewTemplateReadOnly" slice whose value is the name of
the tiddler containing the read-only template definition. In this
example, the tiddler title is the same as the slice name (i.e.,
ViewTemplateReadOnly), but that is not *required*: you could you any
name you want for the alternative, read-only template definition.
Note: in addition to the "ViewTemplateReadOnly" slice, there are other
slice values you *could* define in the theme: "StyleSheet",
"PageTemplate", "ViewTemplate", "EditTemplate", and
"EditTemplateReadOnly". For your purposes, only the
ViewTemplateReadOnly slice needs to be defined. The others will use
the standard default values.
To activate your theme, add the following to a tiddler, tagged with
systemConfig:
config.options.txtTheme="MyTheme";
after you save-and-reload, your theme should be in effect.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
----------
Was this answer useful? If so, please help support TiddlyTools:
TiddlyTools direct contributions: (paypal)
http://www.TiddlyTools.com/#Donate
UnaMesa tax-deductible contributions:
http://about.unamesa.org/Participate (paypal)
TiddlyWiki consulting:
http://www.TiddlyTools.com/#ELSDesignStudios
http://www.TiddlyTools.com/#Contact