Hi everyone,
Let me explain the method I am using to do these custom templates. I am not changing the existing $:/tags/ViewTemplate or $:/tags/EditTemplate architecture at all. The $list widget that builds each tiddler in the story-river still does exactly that. What I have done is gone into key system tiddlers with those tags and found the "bare minimum" code used to render the content, moved that to a macro, such as `\define tiddler-body-default()`. Then, in that place in the system-tiddler, I put (cutting out the debug and "missing tiddler" fail-safe code):
<$list variable="sectionTemplate" filter="[all[current]subfilter{$:/config/ui/ViewTemplate/body}]" emptyMessage=<<tiddler-body-default>> >
<$transclude tiddler=<<sectionTemplate>> >
<$/list>
This checks the $:/config/ui tiddler specified for a series of filters, and uses those titles as sections. BY DEFAULT this will return empty and place the original code back using the `emptyMessage` parameter. Because the list hosting these `sectionTemplates` exist in the tiddler defining the <<tiddler-body-default>> definition, I can use that macro anywhere in my own templates to render the default __whatever__, be that into a tab, a $reveal widget, a new <$div> with a specific class or id value that is a filtered translcusion (triple braces), etc. So I can insert or hide/show the default chunk of code within my own templates. So my glossary template tiddler is as simple as:
<<tiddler-body-default>>
<<glossary-item>>
The <<tiddler-body-default>> code is defined within the $:/tags/ViewTemplate "body" tiddler, and the <<glossary-item>> code is defined in a global macro tiddler ($:/tags/Macro) because I re-use it in other templates.
Because we are using the `subfilter{configTiddler}` operator, each filter run in that config tiddler gets fed the <<currentTiddler>> value. Then, the output is collected and returned as a title-list. This is used to render the new UI for that section. The use of filters allows __whatever__ custom triggers, conditionals, etc, you can conceive by using the current filter operators. I am currently using the existence of a tag for both the Glossary and $:/tags/Macro custom bodies. I will be building UI for my Youtube, Vimeo, etc bookmarks to transclude their player-embed code by grabbing the right parts from their link URL, and drive that on [tag[Bookmark]regexp:url<youtube-domain>], or [tag[Bookmark]regexp:url<vimeo-domain>], or whatever.
I realize now that one of the things that sparked this idea was listening to Jeremy on one of the tiddly-hangout videos talk about how robust the filter operator "language" has become now, and that many things in the core that were done in other ways could be revisited using Filters as the primary syntax. This plus seeing some of the really cool stuff being developed recently, and getting a better sense of how TW renders things "under the hood". Thanks for trying this out, and for all the feedback so far!
Best,
Joshua Fontany