How to get the parent tag of another tag?

88 views
Skip to first unread message

Shash

unread,
Sep 22, 2015, 12:14:52 PM9/22/15
to TiddlyWiki
Hello all,

I am currently using the below list operator. Instead of just listing out the tiddlers based on the current tiddlers's tags, I would like to list the tiddlers of even its parent tags as well. Is there any easy way to achieve this. 

<$list filter="[is[current]tagging[]sort[listing]]">
<$link><$view field="title"/></$link>


Regards
Shash

Tobias Beer

unread,
Sep 22, 2015, 1:01:23 PM9/22/15
to tiddl...@googlegroups.com
Hi Shash,

This...

<$list filter="[is[current]tagging[]sort[listing]]">

...does not give you a tiddler's tags, but this does:

<<list-links [is[current]tags[]]>>

...and then this gets you the tag parents of the first level parent tags:

<<list-links [is[current]tags[]tags[]]>>

...and if you want both, first level and second level parent tags in one list, you'd be doing:

<<list-links [is[current]tags[]][is[current]tags[]tags[]]>>

Eventually, if you also wanted to go down the tagging tree,
to "child tiddlers" tagging to the current one,
you'd be replacing the tags[] filter operator with
the tagging[] filter operator in the examples above.

Here are the basics to all that:

Shash

unread,
Sep 22, 2015, 1:51:34 PM9/22/15
to TiddlyWiki
Hi Tobias,

My use case is little different. I have the below code. I have it as a viewtemplate. For example , I have a tag 'Chapter 1'. Under 'Chapter 1' I have tag 'Topic 1'. So whenever I click on Topic 1, I want the table to load all the tiddlers of 'Chapter 1' tag as well as tiddlers of 'Topic 1'. Can you please help me in this. 
<table >
<tr >
<td style="width:35%";>
<$scrollable class='tc-scrollable-demo'>
<$list filter = "[is[current]tagging[]]">
<span class="textbox2"> 
<$link><$view field="title"/></$link>
<div style="max-height:5px; overflow: hidden;"> <br> <$transclude/> </div> 
</span>
</$list>
</$scrollable>
</td>
<td>
{{!!text}}
</td> 
</tr>
 </table>

Thanks!
Shash



On Tuesday, September 22, 2015 at 10:31:23 PM UTC+5:30, Tobias Beer wrote:
Hi Shash,

This...

<$list filter="[is[current]tagging[]sort[listing]]">

...does not give you a tiddler's tags, but this does:

<<list-links [is[current]tags[]]>>

...and then this gets you the tag parents of the first level parent tags:

<<list-links [is[current]tags[]tags[]]>>

...and if you want both, first level and second level parent tags in one list, you'd be doing:

<<list-links [is[current]tags[]][is[current]tags[]tags[]]>>

Eventually, if you also wanted to go down the tagging tree,
to "child tiddlers" tagging to the current one,
you'd be replacing the tags[] filter operator with
the tagging[] filter operator in the examples above.

Best wishes,

— tb

Tobias Beer

unread,
Sep 22, 2015, 4:24:23 PM9/22/15
to TiddlyWiki
Hi Shash,

I have it as a viewtemplate.


2 Questions:
  1. Where do you want that?
  2. How do you want it? => can you provide an example outline (formatted as nested lists, right here) 
I can imagine the TableOfContents Macro might be of help.

Or do you actually want to show all the contents?

Then this might do: makedoc @ tb5

Then

Best wishes,

— tb
Reply all
Reply to author
Forward
0 new messages