I am trying to customise the View template for a subset of tiddlers, but something doesn’t work and I can’t figure out why. I tried to minimise the example for simplicity, what am I missing?
This is the test tiddler that is supposed to be shown differently in view mode Tiddler with custom View template.tid
created: 20260124184932994
modified: 20260124185721965
tags: CustomViewTemplateTag
title: Tiddler with custom View template
This tiddler is tagged with `CustomViewTemplateTag`.
This is the custom View template CustomViewTemplate.tid
created: 20260124185208492
list-before:
modified: 20260124190055597
title: CustomViewTemplate
type:
This is a custom view template
---
{{!!text}}
As I understand, empty list-before makes sure it appears at the top of the cascade stack.
And this is the filter that tells TiddlyWiki which tiddlers to render through the custom template CustomViewTemplateFilter.tid
I swear I went over the docs at tiddlywiki.com multiple times. I studied a plugin that does this. I stared at my code multiple times. I even went desperate and tried to ask Gemini about it. The outcome was expectable (not that I had big hopes) - it ran me in circles playing The Boy Who Cried Wolf - Wikipedia with me and ultimately leaving me in an even more frustrated state of mind Yet I failed to spot the problem on my own. Of course it’s a PEBCAC problem. Maybe it’s a lack of focus issue. But what tricks are there that would help me finding the issue on my own? I’m really not looking for a magic wand, but every time I hit a wall like this, I want more tools, more feedback from TiddlyWiki somehow, telling me I did wrong. By analogy with traditional programming languages, I severely lack tools like verbose tracebacks/linters/type hinters etc. I am morally prepared for basic things I try to write to not work from the first attempt. What gets me is that I ultimately have to resort to asking for help in forum.
I will elaborate a little on what I mean in this particular case. A tiddler is a very abstract thing and generally TiddlyWiki can’t know what the user might use the tiddler for. However, in the example above CustomViewTemplateFilter is a cascade filter. Not even because it has Filter in name, that does not matter at all. But because of the $:/tags/ViewTemplateBodyFilter tag, not just a tag, it’s a specially prefixed system tag. Ideally, TiddlyWiki should’ve warned me about the lack of the list-before field in it somehow?
The Order of Tagged Tiddlers determines the order in which the conditions are processed, and provides the means for arranging new rules at specific points in the cascade.
If you then follow the link to Order of Tagged Tiddlers, it explains how to control the order using the list, list-before, and list-after fields.
Going off topic here. My apologies.
I’m sure that I heard the expression PEBCAC (or PEBKAC) before, but I looked up the abbreviation and I couldn’t help laughing out. Maybe because I’ve had many frustrating days trying to straighten things out on my computer, mainly my wikis. Thank you for the laugh.
As a bit of a sidebar that also touches upon your concern here…
Most advice on using the template cascades (and nearly all the prepackaged solutions) shared here will suggest using list-before to ensure that your new config appears before the default. This is, in large part, precisely because the cascade filters can be configured with a tag, and we can’t know whether you have already modified the sequence via the tag-pill or what other cascade filters you may already be using. list-before and list-before: (default value) are always safe ways to ensure that the config tiddler appears, respectively, at the top of the list or immediately before the fallback value.
However, if you’re writing cascade filters purely for your own use (not to share them with others who may have different configurations), you can take advantage of the tag-pill drag-and-drop feature. As an example, here’s what the Field Editor cascade looks like immediately after I created a new config tiddler (with nolist-... field):
This is actually my preferred method of ordering cascade filters in any wiki I’m building for my own purposes. I find it has two major advantages:
If I’m using several (or many!) separate cascade filters, it’s easier to drag and drop them where I want them than to manually add list-before or list-after fields to each tiddler.
Creating the config tiddler is the last step I take whenever I add a new view template, and I typically do so by cloning and editing a preexisting config tiddler. This means I have to go into the appropriate Cascades tab, open a filter tiddler, clone it, and save it, and my new filter will appear automatically at the bottom of the list. I can look at the list of filters and see, at a glance, the order in which they will be applied. And the tag-pill is right there, so I can quickly rearrange them as needed.
I find this method avoids any confusion about which field belongs where: your newly created view template tiddler doesn’t have a system tag, so it can’t be the one that needs to be positioned!
In conclusion, and re: your point I quoted above: I’m not sure it would be practical to warn about missing list-... fields on cascade config tiddlers, because it’s very possible to use them effectively without ever adding a list-before.
If course do look at the recently developing codemirror 6 as in included tiddlywiki syntax, lookup and linter, not that it would have assisted with the above.