tag trees

235 views
Skip to first unread message

David Andel

unread,
Aug 2, 2013, 9:16:30 AM8/2/13
to tiddl...@googlegroups.com
Hi all

So far I like TW5 very much.

One thing I have been looking for I could not find: I would like to be able to sort tags into tree structures. And then show all tiddlers which e.g. have a tag which is a person, or a city. I thought this may be doable by TagglyTagging but don't see a clear way yet.

Is this already doable or is it planned for the core of TW5? Or would such a thing be implemented as a plugin?

Thanks and cheers,
David


Jeremy Ruston

unread,
Aug 2, 2013, 12:45:36 PM8/2/13
to TiddlyWiki
Hi David

There's no built in support for tag trees per se, but I think the necessary components are in place.

Lets assume we have a bunch of tiddlers that are tagged, and that those tags are either tagged "person" or "city".

In TW5, you can transclude a list of tiddlers with triple curly braces around a tiddler filter. This gives you all the tags that are tagged "person":

{{{ [tag[person]] }}}

This gives you all the tiddlers tagged with tags that are tagged "person":

{{{ [tag[person]tagging[]] }}}

Finally this one gives you all the tiddlers tagged with tags that are tagged by tags that are tagged "person":

{{{ [tag[person]tagging[]tagging[]] }}}

Things get a bit more interesting if we introduce templates. Assume that this is the text of a tiddler called "HierarchicalTagTemplate":

<div style="padding:1em;">
<$transclude template="$:/core/ui/TagTemplate"/>
{{{ [is[current]tagging[]] ||HierarchicalTagTemplate}}}
</div>

Then we can display a tree of tags from a particular root like this:

<$transclude template="TestTemplate" target="RootTag"/>

Right now, TW5 will go into an infinite loop if you have a circular tagging loop; which needs fixing.

There is documentation about the filter syntax here:


And documentation about list transclusion here:


Best wishes

Jeremy






--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Leo Razoumov

unread,
Aug 7, 2013, 4:52:42 PM8/7/13
to tiddl...@googlegroups.com
On Fri, Aug 2, 2013 at 12:45 PM, Jeremy Ruston <jeremy...@gmail.com> wrote:
> [..snip..]]
> Finally this one gives you all the tiddlers tagged with tags that are tagged
> by tags that are tagged "person":
>

My mind exploded right there :-)

--Leo--
Reply all
Reply to author
Forward
0 new messages