On Tuesday, April 7, 2020 at 10:19:33 PM UTC+2, Mat wrote: > > tags: $:/tags/ViewTemplate > text: > <$list filter="[all[current]tag[Foo]]"> > ... > > > Such "conditional viewtemplates" are cool but I have a feeling they can be > very inefficient in that such custom templates often only get positive hits > for *very few* tiddlers. (Is my reasoning flawed?) >
I'm not sure, if I understand the question right. .. It will *always hit* for tiddlers tagged: Foo in your example. Is there instead a *targeted* way to control which viewtemplates the > *current* tiddler shows? > > For example, is there some pragma that, for current, can command "show > fields *a *and* b* but not the *text* field nor the *tags*"? > This is a completely different thing. The above code will just add something like a "footer" to the ViewTemplate. All elements taged $:/tags/ViewTemplate are visible _plus_ the new component. Showing a different ViewTemplate could be done by using a new field. BUT .. It would need new core code to support it. We can't use the type field, since this is responsible to define the parser, that should be used for the wikitext. ... At the moment the list-widget is responsible for the view-template that is used. see: https://tiddlywiki.com/#ListWidget $:/core/ui/PageTemplate/story tiddler contains the list-widget, which uses the content from $:/config/ui/ViewTemplate and $:/config/ui/EditTemplate to define the defaults. Ot's possible to "globally" set those templates by the user. ... but there is no "per tiddler" configuration atm. The "story" has no idea about the single tiddler content. It's $:/core/ui/ViewTemplate that would need to be changed. The list there looks like this: <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem"> <$transclude tiddler=<<listItem>>/> </$list> If we change a part from the filter from tag[$:/tags/ViewTemplate] to eg: tag[$:/tags/myTemplate] based on a tiddler field, it should work "out of the box". ... Maybe ;) -m -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/e14c32c6-9765-4de2-9284-3ac950a727f0%40googlegroups.com.
