Something like this may result in the kind of spacing you want and
pre-detect grandchildren. Perhaps you don't even want the top-level to show
if there are no grand children?
The <$list filter="[tag<Parent>limit[1]]"> listwidget here is used to
detect if there are grandchildren. It's limited to 1 instance, since you
don't want to multiply grandchildren by grandchildren.
\define tagtable(Tag)
<ul>
<li><$link to="""$Tag$""">$Tag$</$link></li>
<ul>
<$list filter="[tag[$Tag$]]" variable="Parent">
<$list filter="[tag<Parent>limit[1]]">
<li><$link to=<<Parent>>><<Parent>></$link></li>
<ul>
<$list filter="[tag<Parent>sort[]]" variable="Child">
<li><$link to=<<Child>>><<Child>></$link></li>
<ul>
<$list filter="[tag<Child>sort[]]" variable="GrandChild">
<li><$link to=<<GrandChild>>><<GrandChild>></$link></li>
</$list></ul></$list></ul></$list></$list></ul></ul>
\end
<$macrocall $name="tagtable" Tag={{!!title}} />
Good luck!
-- Mark
On Friday, August 3, 2018 at 8:20:00 AM UTC-7, Stuart Amor wrote:
>
> Its been awhile since I have used TW5 and its coming back to me slowly...
> I have currently got down to the following code:
>
> \define tagtable(Tag)
> <$list filter="[tag[$Tag$]]" variable="Parent">
> <$list filter="[tag<Parent>sort[]]" variable="Child">
> <$list filter="[tag<Child>sort[]]" variable="GrandChild">
> <ul>
> <li><$link to=<<Parent>>><<Parent>></$link></li>
> <ul>
> <li><$link to=<<Child>>><<Child>></$link></li>
> <ul>
> <li><$link to=<<GrandChild>>><<GrandChild>></$link></li>
> </ul>
> </ul>
> </ul>
> </$list></$list></$list>
> \end
>
> <$macrocall $name="tagtable" Tag='X'/>
>
>
> I have two problems with this, firstly I am not sure how I can pass the
> [all[current]tagging[]] via a macrocall - its not the end of the world if
> I can't, but I have had this situation quite a bit so would nice to be able
> to learn how it can be done if possible.
>
> I have a bit of a dilemma as this code returns:
>
>
> - X
> - Y
> - Z1
> - X
> - Y
> - Z2
>
>
> I would like X and Y to be able to group the Z values and only appear
> once. I can see how this problem occurs, but can figure out a way of
> avoiding this problem without reintroducing the Parent's Children that
> don't have GrandChildren into the report.
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/027d551c-38c6-414f-94ab-e8d677b383e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.