Re: Creating a Table of Contents using Tag Pills instead of individual tiddlers with the tag filter.

111 views
Skip to first unread message
Message has been deleted

Birthe C

unread,
Jun 4, 2020, 12:43:31 PM6/4/20
to TiddlyWiki
Your question send me down memory lane. I remembered that we had an early version of a tagmenu. I looked through my old wikies, as the original link to a dropbox file is long gone.
I found it and it is dated Nov 9 2013 by aSpex.

I hope I succeeded attaching the file,

Birthe



TagMenu.tid

A Gloom

unread,
Jun 4, 2020, 10:00:59 PM6/4/20
to TiddlyWiki
Something I learned from Tobias-- how he did his Solutions ToC at http://tobibeer.github.io/tb5/#Solutions

toc tiddler text field contents:

<$list filter="[tags[]prefix[a]]" template="#index list template">

<-- modify the filter as needed for what ever tag/filtering you're using for your toc list, sort and other filter operatiors can be added -->

template tiddler

title:#index list template

text field contents:

<div class="tc-table-of-contents">
<$transclude tiddler="$:/core/ui/TagTemplate"/><br/>
&nbsp; &nbsp; <span style="font-size:75%;"><$count filter="[all[current]tagging[]]"/> pages</span>
</div>

TonyM

unread,
Jun 4, 2020, 10:21:05 PM6/4/20
to tiddl...@googlegroups.com
Pieter-Michiel,

Have a look at what I did in my prepared codemirror edition it places a tag pill on every tiddler that is acting as a tag, so you can see its children.

If you want a custom toc layout it may be better to build your own recursive macros as discussed in a number of topics.

Here is an example of my own;
\define each-other-level(filter)
<li><$link to=<<currentTiddler>> ><$text text=<<currentTiddler>>/></$link></li>
<ul>
<$list filter="$filter$">
   
<<each-other-level $filter$>>
</$list>
</
ul>
\end
\define first-level(filter)
<ul>
<$list filter="$filter$">
   
<<each-other-level $filter$>>
</$list>
</
ul>
\end

Start in TableOfContents<br>
<$tiddler tiddler="TableOfContents">

<<first-level "[is[current]tagging[]]">>

</$tiddler>
Note: It may not be protected from infinite loops.

Now where the items are listed in the `<li> tags` change the line to
<li><$macrocall $name=tag tag=<<currentTiddler>>/></li>
and I think you have what you are after.

You may want to hide the pill for those items with no tags.

However in my prepared codemirror edition the tag pills are useful,  I plan to add a new here feature as well.

Regards
Tony



On Friday, June 5, 2020 at 12:03:29 AM UTC+10, Pieter-Michiel Geuze wrote:
Friends,

I am very happy working with TW and I have been finding many different ways to use Table of Contents (ToC).

What I am looking to do is to create a ToC not of individual Tiddlers but of Tags, preferabbly Tag Pills.

I believe that this will allow me to see all the tag categories within a tag, click the tag and then see all of the tiddlers from that tag.

If there is another way to do this, please let me know.


TonyM

unread,
Jun 4, 2020, 10:23:49 PM6/4/20
to TiddlyWiki
Sorry I edited my last post to use

<li><$macrocall $name=tag tag=<<currentTiddler>>/></li>

And in the below of this email

Regards
Tony

PMario

unread,
Jun 5, 2020, 8:25:20 AM6/5/20
to TiddlyWiki
Hi,

I did create a personal theme, which is optimized for my preferences. It uses something I call tag-map [1], which is a plugin, that inserts a new tab to the tiddler info area.

See this link to my edition.  If you click a tag pill, it will open the map instead of the dropdown.

If this is similar to your idea, it may be possible to extract something, or create a new theme based on slant-01.

Since it is a theme, it can be switched on and off. See the "themes" button in the right sidebar, where you can switch themes.

have fun!
mario

Reply all
Reply to author
Forward
0 new messages