[TW5] TOC External Navigation Style for a List

155 views
Skip to first unread message

Taylor Jensen

unread,
Aug 30, 2016, 6:41:24 PM8/30/16
to TiddlyWiki
I love the TOCs where clicking opens up a little version of the tiddler to the right of the TOC list. But I need that style of thing for a normal list (because I need more filter options than TOCs are designed for). Does somebody already have something like that made? Or am I going to have to reverse engineer the TOC code?

Unfortunately simple tabs aren't good enough because of the way checkboxes interact when inside the tab instead of the special TOC version of a tab.

-TCJ

PMario

unread,
Aug 31, 2016, 7:20:44 AM8/31/16
to TiddlyWiki
On Wednesday, August 31, 2016 at 12:41:24 AM UTC+2, Taylor Jensen wrote:
... But I need that style of thing for a normal list (because I need more filter options than TOCs are designed for)...
 
What does your filter look like?
IMO the macro could be easily extended (into a new one) that usees a "filter" input variable.

-mario

Taylor Jensen

unread,
Aug 31, 2016, 5:45:44 PM8/31/16
to TiddlyWiki
It's pretty simple tbh. It's just something like [tag{Tiddler}Tag[tag]]. It's allowing me to see all of the tiddlers with a preset tag, and then in a group that gets changed by the contents of [[Tiddler]].

The problem with easily adapting the core TOC code is that each one references the more basic ones before it. So I think I would need to modify all of them? Or maybe I can just copy the TOC code into prefixed macros, and then add tag[tag] to the most basic one's filter.

PMario

unread,
Sep 1, 2016, 10:11:24 AM9/1/16
to TiddlyWiki
On Wednesday, August 31, 2016 at 11:45:44 PM UTC+2, Taylor Jensen wrote:
It's pretty simple tbh. It's just something like [tag{Tiddler}Tag[tag]]. It's allowing me to see all of the tiddlers with a preset tag, and then in a group that gets changed by the contents of [[Tiddler]].

The problem with easily adapting the core TOC code is that each one references the more basic ones before it. So I think I would need to modify all of them? Or maybe I can just copy the TOC code into prefixed macros, and then add tag[tag] to the most basic one's filter.

You are right. They are heavily linked and since the code doesn't have any indentation, it's hard to read it :/

 - BACKUP, BACKUP, BACKUP,

 - I'd use the core macros.
 - copy them to a separate tiddler
 - tag it $:/tags/Macro
 - try to improve readability with some indentations
    - test if it still works ...
 - remove everything, that's not needed for your usecase ... and hope there is something ;)
    - test if it still works
 - give my macros a new name
    - test if it still works
 - add the missing filter
    - test if it still works

find replace with an external editor may be your friend here.

I'm sorry, that's not much help.

have fun!
mario

Taylor Jensen

unread,
Sep 4, 2016, 8:27:46 AM9/4/16
to TiddlyWiki
Here's the solution:

\define note-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"")
<$tiddler tiddler={{$selectedTiddler$}}>
<div class="tc-tabbed-table-of-contents">
<$linkcatcher to="$selectedTiddler$">
<div class="tc-table-of-contents">
<$list filter="[!has[draft.of]tag[note]tag{Active Production}sort[created]]">

<$checkbox tag="done"> <$link to={{!!title}}><$view field="title"/></$link></$checkbox>
</$list>
</
div>
</$linkcatcher>
<div class="tc-tabbed-table-of-contents-content">
<$reveal state="""$selectedTiddler$""" type="nomatch" text="">
<$transclude mode="block" tiddler="$template$">
<h1><<toc-caption>></
h1>
<$transclude mode="block">$missingText$</$transclude>
</
$transclude>
</$reveal>
<$reveal state="""$selectedTiddler$""" type="match" text="">
$unselectedText$
</
$reveal>
</div>
</
div>
</$tiddler>
\end

In the first <$linkcatcher>, where the core toc calls another toc macro, I instead put a list with whatever filter I want (in this case also with checkboxes).

-TCJ
Reply all
Reply to author
Forward
0 new messages