Should cascade filter rule tiddlers be rendered with code body view template?

Should the custom cascade rule filter tiddlers (as in ControlPanel > Info > Advanced > Cascades, all are tagged with some tag like $:/tags/___Filter) be displayed using the code body view template?

Currently there is no mechanism that would automatically make all the custom cascade rules be displayed with code body template.
The core rules are shown with code body template, because they fall into the rule [prefix[$:/config/]] in $:/config/ViewTemplateBodyFilters/system.
However, any custom cascade rule (not prefixed $:/config/) will not be displayed with the code body template, unless e.g. the field code-body: yes is added.

Should we add tag-based rules to $:/config/ViewTemplateBodyFilters/core-ui-tags so that all the custom cascade rule tags are also included there (e.g. $:/tags/EditTemplateBodyFilter, $:/tags/FieldEditorFilter, $:/tags/TiddlerColourFilter), and cause the tiddler to be rendered with code body template?

My rationale is that these tiddlers (custom cascade rule filters tagged with $:/tags/___Filter) will conceivably always be filter expressions, and so would be easier to examine when viewed with the code body template. It would be practical if they were automatically displayed with code body template.
A similar situation is the case for custom stylesheet tiddlers (although they use a different template, but still with code in mind).

Or should it be left to the user, that he uses the code-body field or creates a custom view template body rule if he wishes so?

1 Like

Hi @vilc I think there’s a very strong case that tiddlers with the tags in question should never be wikified for display.

There might be two concerns to think about:

  • The performance implications of testing for many tags. Perhaps we might apply a meta-tag to identify those tags to simplify the logic
  • The difficulties for a user to understand which cascade has been applied to a particular tiddler. We might add a line to the “Advanced” tab of tiddler info showing a link to the cascade that has been applied

By this, do you mean that, for instance, the tiddler $:/tags/ViewTemplate would itself be tagged $:/tags/meta/MyShinyNewCascadeMetaTag, which we would then search with via

<% if [<currentTiddler>tags[]tag[$:/tags/meta/MyShinyNewCascadeMetaTag]]` %> ... <%endif %>

If so, is that clearly more efficient? (I’m just curious; I use that pattern often and find it useful, but I never really thought about it as a more performant replacement for searching for the separate tags individually; they might well be dynamic. But I guess it would be nice to know when I’m doing the right thing for the wrong reasons.)

Or cascades, plural, correct? There is one for the view body, one for the title, on for the icon, one for the color? Or am I missing something?

1 Like