Help with default tiddler templates.

79 views
Skip to first unread message

Jason Nordin

unread,
Mar 7, 2017, 2:46:43 PM3/7/17
to TiddlyWiki
I'm working with Tiddlermap that shows tags as edges, and I want (1) each new tiddler created to have a basic toc-selective-expandable (2) for all the tiddlers who are tagged by said tiddler. So I can easily, automatically link-list each item's children on every card. Ideally, I can also see its parents in another list? Or other edges? But that's not as important.

<<toc-selective-expandable _TagHere_ sort[]>> works just fine if I just paste it in, but I want it to be there by default when it is created.
And it doesn't show up without specifying an actual tag because of weird no-macros-in-macros reasons I don't understand well enough to fix. I want it to automatically use the tiddler's title without having to enter it; otherwise it defeats the purpose of not having to edit every single one.
I've got a successful template edit using <$edit-text field="toc" default="" placeholder="Contents Order" tag="input"/> so I can arbitrarily order them if I want on the Contents tab I added. But why won't the toc macro apply to the template?

What do I use to make this work?

Mat

unread,
Mar 8, 2017, 1:36:15 PM3/8/17
to TiddlyWiki
Hi Jason!

To put macros in macros you can use the macrocall widget. This is a more primitive building block in TW. So basically you tell the macrocall widget which macro it is you want to use (the toc macro) and then which other macro (or whatever) that should be the input argument to that first macro.

Once you have that working you can tag the tiddler with $:/tags/ViewTemplate to have it be part of every tiddler.

To have the macro access the tiddlers title, I think you can use {{!!title}} (...there is a chance this will refer to the title where the macro resides but I think it shold work)

Sorry no time to test this as I'm in a rush. But it should get you started.

<:-)
Reply all
Reply to author
Forward
0 new messages