> Thats why I thought it would be a good idea, to implement my
> suggestions (one new line and 2 changes) into the original macro.

To be accurate, the *original* theme switching macro was my
SelectStylesheetPlugin, which implemented the first multi-stylesheet
"named theme" support in TW, way back in July 2005.

At my urging, most (though not all) of this functionality has long
since been incorporated into the core, and SelectStylesheetPlugin was
completely superseded in early 2008 by SwitchThemePlugin which is, of
course, very compact because it is built on top of that core
functionality.

Since then, others have written their own alternative theme switchers
mostly, I suspect, because they were not aware of my existing
TiddlyTools plugin (which is, unfortunately, often the case, as I have
written so many plugins)

One original feature that my plugin still offers that the others do
not, is support for special "Check", "Init", and "Reset" values
associated with a given theme.  These slice values allow you to make
reference to tiddlers containing custom javascript handlers that will
be automatically invoked when switching to/from a given theme.

The "Check" handler can be used to prevent a theme switch if certain
conditions are not met, such as checking the screen resolution or
asking the user to confirm the use of a theme before switching to it.

The "Init" handler performs actions just prior to switching to a
selected theme.  These actions provide programmatic 'side effects' in
addition to the usual the CSS and template switching that is performed
by the core, such as adjusting values stored in config.options[...],
or changing 'menu' tiddler content to match the new theme layout.

Similarly, the "Reset" handler performs actions just prior to
switching away from the current theme.  This permits reversal of any
side-effect processing previously performed (e.g, resetting
config.options and menu tiddlers).

> I use the chars < x # > to hide and show the sidebar and left menue,
> by switching the page template.

Changing templates is a very drastic action.  In addition to changing
the page layout, it will also trigger a complete re-rendering of all
currently displayed tiddlers.  If those tiddlers are script-driven or
otherwise have significant rendering overhead, simply hiding the
sidebar can cause a major amount of processing to be invoked.

You might want to use these instead:
   http://www.TiddlyTools.com/#ToggleLeftSidebar
   http://www.TiddlyTools.com/#ToggleRightSidebar

Unlike the template switching approach you are using, these
'transclusion' tiddlers show/hide (not *remove*) the #mainMenu and/or
#sidebar elements and then adjust the displayArea margins to match.
The benefit of this CSS-based method is that there is *no* rendering
overhead for re-processing tiddler source content, and the browers
takes care of automatically 'reflowing' the text within displayed
tiddlers to fit the new element widths.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to