Question about renaming tiddlers when listing with filters

On TiddlyDesktop, single file.

My tiddlers are organized as follows: a tiddler used as a dashboard, say, named ‘FeatureA’, and some child tiddlers named ‘FeatureA/idea_n’. In the dashboard, I want all child tiddlers to be listed automatically, and additionally, with the prefix ‘FeatureA/’ removed.

I managed to do so, but the process is a bit troublesome.

This is the final core part:

<$let cc=<<currentTiddler>>>
<$list filter="[prefix<cc>!title<cc>sort[created]]">

<$link to=<<currentTiddler>>>
    <$text text={{{[{!!title}]+[removeprefix<cc>]+[removeprefix[/]]}}}/>
</$link>

</$list>
</$let>

And this is a version with problem:

<$let cc=<<currentTiddler>>>
<$list filter="[prefix<cc>!title<cc>sort[created]]">

<$link to=<<currentTiddler>>>
    {{{[{!!title}]+[removeprefix<cc>]+[removeprefix[/]]}}}
</$link>

</$list>
</$let>

Both version successfully display the link, but the latter links to the tiddler without prefix, which does not exist, of course.

I guess it is because syntax like {{{[]}}} also creates a link, which covers the <$link>. I am not quite certain as I am new to tiddlywiki. Can any one tell me the actual cause? And, is there any more elegant approach to my demand? Thanks a lot.

You are correct that using {{{ ... }}} inside the $link widget “also creates a link, which covers the <$link>”.

The only thing I would suggest is some minor cleanup of your working solution:

<$let pre={{{ [<currentTiddler>addsuffix[/]] }}}>
<$list filter="[prefix<pre>sort[created]]">
   <$link><$text text={{{ [{!!title}removeprefix<pre>] }}}/></$link>
</$list>
</$let>

notes:

  • calculate the desired prefix (currentTiddler + “/”) once
  • filtering for that prefix won’t include the current tiddler title
  • $link uses to=<<currentTiddler>> by default, so you can omit the param
  • you can “chain” the link text filter operators without using +[...]

enjoy,
-e