TW5 basics, how to create a list of tiddler tagged with current tiddler

661 views
Skip to first unread message

passingby

unread,
Apr 30, 2017, 11:05:26 AM4/30/17
to TiddlyWiki
Hello everybody,

I am coming back to tiddlywiki after a long time. I am trying to learn the basics (yet again!) but I am getting confused and lost (yet again!)

In the current tiddler I am trying to display a list of tiddlers tagged with the title of current tiddler. (exactly as the tagging shown under the info in the tiddler toolbar)

Why is this not working:
<<list-links filter:"[tag[{{currentTiddler!!title}}]]">>
or 
<<list-links filter:"[tag[{{!!title}}]]">>

And while at it I am pretty confused between the list-link macro and list widget. Why are there two doing seemingly similar stuff?

please explain as if I am five. Thanks!

Mark S.

unread,
Apr 30, 2017, 11:20:05 AM4/30/17
to TiddlyWiki

You're trying to concatenate the output of a transclusion into a text string (<<list-links filter:"[tag[{{currentTiddler!
!title}}]]">>). You would need to use a macro to concatenate a transclusion that way.

Fortunately, since the string specifies a filter, there is a special syntax for using a variable inside a filter. So you can write:

<<list-links filter:"[tag<currentTiddler>]">>

The square brackets of the tag operator are replaced by angle brackets and the name of the variable goes inside.

HTH
Mark

Jeff Vance

unread,
Apr 30, 2017, 12:15:24 PM4/30/17
to TiddlyWiki
I do this so often that I created several snippets that I insert regularly (using the snippet editor button), each listing titles in a different way.  I use all of these different methods depending on the kind of content and how much of it there is. These might give you other ideas:


Titles in bullets (sorted):

<<list-links "[tag{!!title}sort[]]">>



Tiddlers in tabs:

<$macrocall $name="tabs"
    tabsList="[tag{!!title}]"
    class="tc-vertical"
  />



Table of contents expandable

<$set name="this" value={{!!title}}>
<
<toc-selective-expandable "$(this)$">>
</$set>



TOC internal navigation

Note that for these, I customize the state tiddler to a unique name for each TOC so currently selected tiddler doesn't show up in other TOCs. I also made it a "popup" state because I didn't want it to save state for every single TOC between loads. But others may prefer to keep the state of the selected title, in which case you could save it it $:/state/toc/

<$set name="this" value={{!!title}}>
  <$macrocall $name="toc-tabbed-internal-nav"
  tag="$(this)$"
  selectedTiddler="$:/state/popup/toc/$(this)$"
  />
</$set>



TOC external navigation:

<$set name="this" value={{!!title}}>
  <$macrocall $name="toc-tabbed-external-nav"
  tag="$(this)$"
  selectedTiddler="$:/state/popup/toc/$(this)$"
  />
</$set>




passingby

unread,
Apr 30, 2017, 1:39:42 PM4/30/17
to tiddl...@googlegroups.com
Thank you! 
Can you link me to more information on use of single angle brackets? Is it just this special case or is it used in other situations too. I mean, I could not find it in the tiddlywiki.com documentation.  

passingby

unread,
Apr 30, 2017, 1:42:19 PM4/30/17
to TiddlyWiki
Thank you Jeff. This indeed is very useful. Thank you very much. What is "Snippet Editor Button" though? 

Jeff Vance

unread,
Apr 30, 2017, 2:10:06 PM4/30/17
to TiddlyWiki

I'm referring to the button in the editor toolbar that says  "Insert a preconfigured snippet of text".  I created custom entries for each of those examples.

passingby

unread,
Apr 30, 2017, 2:16:49 PM4/30/17
to TiddlyWiki


On Sunday, April 30, 2017 at 11:40:06 PM UTC+5:30, Jeff Vance wrote:

I'm referring to the button in the editor toolbar that says  "Insert a preconfigured snippet of text".  I created custom entries for each of those examples.

Oh! I was totally ignoring the toolbar! That is a nice function to have. Thanks again! 

Mark S.

unread,
Apr 30, 2017, 4:35:50 PM4/30/17
to TiddlyWiki
It's in the introduction to filters:

http://tiddlywiki.com/#Introduction%20to%20filter%20notation

I guess the question is, where should this information be repeated for better visibility?

Good luck!
Mark

alex li

unread,
Apr 4, 2020, 7:25:14 AM4/4/20
to TiddlyWiki
Hi Jeff Vance, The Table of contents expandable is not work for me now, is there something change?

I'm using TiddlyWiki5

在 2017年5月1日星期一 UTC+8上午12:15:24,Jeff Vance写道:

David Gifford

unread,
Apr 4, 2020, 10:44:28 AM4/4/20
to TiddlyWiki
<<list-links filter:"[all[current]tagging[]]">> is the 'proper' way I was always taught by my grandparents.

David Gifford

unread,
Apr 4, 2020, 10:45:40 AM4/4/20
to TiddlyWiki
"concatenate the output of a transclusion" is not the way to explain to someone as if theyt were five... :-)

David Gifford

unread,
Apr 4, 2020, 10:50:39 AM4/4/20
to TiddlyWiki


And while at it I am pretty confused between the list-link macro and list widget. Why are there two doing seemingly similar stuff?

The list widget came first. And to do a list of tiddlers as links you had to write this whole thing:

<$list filter="[all[current]tagging[]]"><$link><$view field="title"/></$link><br></$list>

So they came up with the list-links macro to shorten that procedure to

Mat

unread,
Apr 4, 2020, 11:43:36 AM4/4/20
to TiddlyWiki
David Gifford wrote:

<$list filter="[all[current]tagging[]]"><$link><$view field="title"/></$link><br></$list>

That's syntax from your grandma. The hipsters do this nowadays:

<$list filter="[all[current]tagging[]]"><$link/><br></$list>

or perhaps just...

<$list filter="[all[current]tagging[]]">

</$list>

<:-)
Reply all
Reply to author
Forward
0 new messages