Confused about Stylesheet and Template

25 views
Skip to first unread message

sam paul

unread,
Feb 27, 2025, 1:22:07 PMFeb 27
to TiddlyWikiClassic
I am confused about PageTemplate, EditTemplate, ViewTemplate. Is there some overwrite priority between them? PageTemplate should contain the configuration of EditTemplate and ViewTemplate right?

Also for StyleSheet, StyleSheetColors, StyleSheetLayout, StyleSheetPrint. Does StyleSheet contain the configuration for StyleSheetColors, StyleSheetLayout, StyleSheetPrint?

Best.

Yakov

unread,
Feb 28, 2025, 8:32:20 AMFeb 28
to TiddlyWikiClassic
Hello Sam,

yeah, this is a topic to be better documented, so let me start with the basics. The overall topic is TiddlyWiki Themes.

When a theme is applied, the following default or custom bits are applied (if specified):
  • PageTemplate – represents the layout of the whole page. The default one has a header (will be simplified in 2.10.3), a main menu, a sidebar, and #displayArea which consists of #tiddlerDisplay and #messageArea.
  • ViewTemplate and EditTemplate define how a single tiddler can be represented, i.e. view mode and edit mode. Sometimes, other templates are used (for instance, the folded state in CollapseTiddlersPlugin and applying custom templates based on tiddler tag in TaggedTemplateTweak).
    • There's no priority between these, as tiddlers are always displayed inside #tiddlerDisplay, so all 3 templates represent different pieces of the interface. You can have PageTemplate without #tiddlerDisplay, but it won't make much sense in most cases.
  • StyleSheet – contains custom styles. Unlike StyleSheetColors, StyleSheetLayout, and StyleSheetPrint, it is empty by default; you can think of these 3 as "default" styles and StyleSheet as the place for custom styles. That's why only StyleSheet is included into themes.
So the basic idea is that PageTemplate, ViewTemplate, EditTemplate, and StyleSheet are the customizable bits while StyleSheetColors, StyleSheetLayout, and StyleSheetPrint should stay untouched unless you have a very strong reason to edit them (in any case, you can overwrite the styles in StyleSheet).

You can also remember that there's ColorPalette the defines UI colors and is used in StyleSheetColors, but can also be used in StyleSheet (it's a good idea to follow the main colors, which are switched, for instance, with the DarkModePlugin).

These parts are briefly described in Customisation, but if you have a suggestion about clarifying the docs, let me know.

Does this clarify what you were confused with?

Best regards,
Yakov.

четверг, 27 февраля 2025 г. в 21:22:07 UTC+3, samp...@gmail.com:

Roma

unread,
Mar 1, 2025, 7:21:45 AMMar 1
to TiddlyWikiClassic
Although I deducted more or less what you explain, it makes clearer and thus is very useful. Thank you, Yakov.
Reply all
Reply to author
Forward
0 new messages