List with tags and links to topics

61 views
Skip to first unread message

Mike Andyl

unread,
Jul 3, 2021, 11:18:15 AM7/3/21
to TiddlyWiki
I love this kind of list I found in the documentation.
https://i.imgur.com/4Hh7Rcs.jpg

<ol>
<$list filter="[tag[Features]sort[title]]">
<li><<currentTiddler>></li>
{{||$:/core/ui/ViewTemplate/tags}}
</$list>
</ol>


But I want to be able to click on the headings to navigate. And it just doesn't work (only Camel case on example).
I tried to put it inside the HTML but it doesn't work.

<a class="tc-tiddlylink" href="#<<currentTiddler>>"><<currentTiddler>></a>
<a class="tc-tiddlylink" href="#{{!!title}}">{{!!title}}</a>


Variables <<currentTiddler>> {{!!title}} are not readable inside the HTML tag <> and no links are received.

https://i.imgur.com/QD3MXR1.jpg

amreus

unread,
Jul 3, 2021, 11:38:37 AM7/3/21
to TiddlyWiki
Could use a link widget...

<ol>
<$list filter="[tag[Features]sort[title]]">
<li><$link/></li>
{{||$:/core/ui/ViewTemplate/tags}}
</$list>
</ol>

Soren Bjornstad

unread,
Jul 3, 2021, 11:45:36 AM7/3/21
to TiddlyWiki
Generally, the only time you should use an <a> tag in TiddlyWiki is for external links. Otherwise, <$link> makes more sense, as this handles some functionality for you, like adding the # and applying appropriate styles if the tiddler is missing, a shadow tiddler, etc.

As for why what you did didn't work, this is never valid syntax in TiddlyWiki:

attribute="text{{transclusion}}"

Within attributes, transclusions are not evaluated within quotes. Thus, the value of an attribute can be either a constant value in quotes, or a transclusion (<<variable>>, {{field}}, or {{{filtered}}}) -- not both. If you need to concatenate several things in the value of an attribute, you can use either a macro with text substitution:

\define concat() text$(transclusion)$

<$set transclusion={{transclusion}}>
<$widget attribute=<<concat>>/>
</$set>

Or a filtered transclusion:

<$widget attribute={{{ [[text]addsuffix{transclusion}] }}}/>

Reply all
Reply to author
Forward
0 new messages