Nested List refer to title of outer list tiddler

54 views
Skip to first unread message

Simon

unread,
Sep 18, 2020, 11:20:31 PM9/18/20
to TiddlyWiki
Hi,

Sorry if this is super noob but any help is much appreciated.

I'm trying to created a nested list - I'm using GSD5 and I want to get all the top level projects and list their sub projects underneath. I understand how that is setup in GSD I am struggling with the list.

Here is what I have so far:
<$list filter="[gsd_type[project]gsd_project[]]">    <===gets top level and works
  <$link to={{!!title}}><$view field="title"/></$link><br>
     <$list filter="[gsd_type[project]gsd_project[{{!!title}}]]">   <===struggling here
            <$link to={{!!title}}><$view field="title"/></$link><br>
     </$list>
</$list>

The problem is in line 3 - I am trying to get it to find all the tiddlers that have the title in gsd_project from the outer list

I want it to look like this
Main Project
Sub1
Sub2
Main Project2
Sub1
Sub2

I'll handle formatting & indenting later, right now I'm just working on the syntax on this

Thanks
Simon

Mark S.

unread,
Sep 19, 2020, 12:06:36 AM9/19/20
to TiddlyWiki
Without spending an hour to try to mock up your data, try ...

 <$list filter="[gsd_type[project]gsd_project<currentTiddler>]">   <===struggling here

Double {{ braces }} are only used OUTSIDE filters. Double << chevrons >> are also used OUTSIDE filters.

Inside filters, use { single } braces and < chevrons > .

Notice that I simplified the filter a bit and used <currentTiddler> rather than {!!title} (which would have also worked. Using variables sometimes makes things easier, because you can give each nested tiddler it's own via variable="myvar" . But I digress.

Eric Shulman

unread,
Sep 19, 2020, 12:48:03 AM9/19/20
to TiddlyWiki
On Friday, September 18, 2020 at 8:20:31 PM UTC-7, Simon wrote:
I'm trying to created a nested list - I'm using GSD5 and I want to get all the top level projects and list their sub projects underneath. I understand how that is setup in GSD I am struggling with the list.
Here is what I have so far:
<$list filter="[gsd_type[project]gsd_project[]]">    <===gets top level and works
   <$link to={{!!title}}><$view field="title"/></$link>
<br>
   <$list filter="[gsd_type[project]gsd_project[{{!!title}}]]">   <===struggling here
      <$link to={{!!title}}><$view field="title"/></$link>
<br>
   </$list>
</$list>


Try this:
<$list filter="[gsd_type[project]gsd_project[]]">
   <$link /><br>
   <$list filter="[gsd_type[project]gsd_project
<currentTiddler>]">
      <$link />
<br>
   </$list>
</$list>

Notes:
1) The $list widget sets the value of <<currentTiddler>> unless you use the variable="something" parameter.
2) By default, text for the $link widget will match the tiddler title specified in the to=... parameter,
   and the default value for the to="..."parameter is the <<currentTiddler>> value.
   Thus, <$link /> is all that is needed to link to the <<currentTiddler>>.
3) Within filter syntax, the brackets surrounding an operand vary depending upon the type of value being specified:
   use [...] for literal text, {...} for tiddler field or index references, and <...> for variable references.
   Thus, gsd_project[{{!!title}}] is incorrect, and would be properly written as gsd_project{!!title}
   and, because the outer $list has set the <<currentTiddler>> value, the filter syntax is gsd_project<currentTiddler>.

enjoy,
-e

Simon

unread,
Sep 19, 2020, 10:49:55 AM9/19/20
to TiddlyWiki
Mark & Eric

Thanks SO much - your help is incredibly helpful. That has got me going - this is SO powerful!!!

Simon

Reply all
Reply to author
Forward
0 new messages