Needing a bit of help with a ViewTemplateTitleFilter

I started working on this out of an enjoyment for how system tiddlers change the $:/ prefix of system tiddlers, and wanted to use that with other titling formats.

One of which that I use is commonly used by websites such as wikipedia, where it is “PageTitle (TitleContext)”

What I was initually able to do was to apply tc-muted to the text in parenthesis if the (TitleContext) part was the prefix to the title, but I’ve been unable to achieve the same result with the (TitleContext) as the suffix, ie “John Doe (Farmer)” where farmer would have the CSS class of .tc-muted applied to it.

I’ve attached a JSON tiddler package with the tiddlers I’ve been working on so far and I thought I had succeeded, but I can’t seem to figure out why the titles won’t render correctly for the metaphorical problem child of said tiddlers.

Any and all help / advice will be appreciated by me, and my remaining sanity.🥲
tiddlers.json (1.2 KB)

Well, this wouldn’t be my first time making a thread and figuring out the solution.

I admit, I feel silly everytime, but I’m glad to have it fixed.

So I figured out that I don’t need to have the else operator in my filters. (Also figured out I had the wrong tiddler as the list-before for one of the filter tiddlers too…)

But here is the fixed version, for anyone who’d like to use them.

tiddlers (1).json (1.2 KB)

1 Like

I know the feeling, but then the end result is still a question and an answer for the forums.

May future tiddler writers learn from our tribulations then :beers: