[tw5] Re: Show tag list only when grandchildren exist

2018-08-03 Thread 'Mark S.' via TiddlyWiki
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="[taglimit[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)


<$link to="""$Tag$""">$Tag$


<$list filter="[tag[$Tag$]]" variable="Parent">
<$list filter="[taglimit[1]]">
  <$link to=<>><>
  
<$list filter="[tagsort[]]" variable="Child"> 
  <$link to=<>><>
  
<$list filter="[tagsort[]]" variable="GrandChild">
   <$link to=<>><> 

\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="[tagsort[]]" variable="Child"> 
> <$list filter="[tagsort[]]" variable="GrandChild">
> 
>   <$link to=<>><>
>   
>   <$link to=<>><>
>
><$link to=<>><>
>
>   
> 
> 
> \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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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.


[tw5] Re: Show tag list only when grandchildren exist

2018-08-03 Thread 'Stuart Amor' via TiddlyWiki
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="[tagsort[]]" variable="Child"> 
<$list filter="[tagsort[]]" variable="GrandChild">

  <$link to=<>><>
  
  <$link to=<>><>
   
   <$link to=<>><>
   
  


\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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/576ae5fd-2792-4005-aeef-5afa0429f933%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Show tag list only when grandchildren exist

2018-08-02 Thread 'Stuart Amor' via TiddlyWiki
Thank you Diego, that has certainly put me on the correct path!  If I 
wanted to take this to the next stage, how could I change the output so 
that it would be presented as a outline structure:


   - Y
   - Z1
  - Z2
   - Q
  - P1
  - P2
   





On Tuesday, 24 July 2018 19:10:41 UTC+1, Stuart Amor wrote:
>
> I am looking for a way of returning a list of all the tiddlers that are 
> tagged with the current tiddler title. However I would like to omit all 
> tiddlers that are not themselves subsequently tagged. 
>
> Let me try to give you an example... if I have three tiddlers X, Y and Z. 
> Within the parent tiddler X, I would like to return a list containing its 
> child Y, provided Y is tagged with X AND Z is tagged with Y (ie X has a 
> grandchild).  However, if there were no tiddlers tagged with Y, then Y 
> would not appear in the listing within X. 
>
> Does that make sense?
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/b409146d-b6be-4a33-97d5-9ae634f0e755%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Show tag list only when grandchildren exist

2018-07-24 Thread Diego Mesa
Hey Stuart,

This code seems to work for me:

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

<$list filter="[tag]" variable="grandchild">

<> has grandchild <>





You can test it on https://tiddlywiki.com/ by making 4 tiddlers:

   - titled X, with the content above
   - titled Y tagged with X
   - titled Z tagged with Y
   - titled Q tagged with X

Best,
Diego

On Tuesday, July 24, 2018 at 1:10:41 PM UTC-5, Stuart Amor wrote:
>
> I am looking for a way of returning a list of all the tiddlers that are 
> tagged with the current tiddler title. However I would like to omit all 
> tiddlers that are not themselves subsequently tagged. 
>
> Let me try to give you an example... if I have three tiddlers X, Y and Z. 
> Within the parent tiddler X, I would like to return a list containing its 
> child Y, provided Y is tagged with X AND Z is tagged with Y (ie X has a 
> grandchild).  However, if there were no tiddlers tagged with Y, then Y 
> would not appear in the listing within X. 
>
> Does that make sense?
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/92dfa603-97d6-48f1-9595-bb59027221cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.