A How-To: transclusion template to wrap transclusions in DetailsWidget

70 views
Skip to first unread message

Charlie Veniot

unread,
Mar 26, 2021, 3:36:04 PM3/26/21
to TiddlyWiki
G'day,

Me thinks this sample TiddlyWiki o' mine covers it all.

Please, any questions or flubs that need fixing, get back to me here.

Cheers !

David Gifford

unread,
Mar 26, 2021, 11:10:41 PM3/26/21
to TiddlyWiki
Nice!
Very nice and clean.

Just this week I started to use details as sections for articles. I use simple transclusion of the details tiddler in the article tiddler, and with a new button I create the details tiddler. Mine works when exporting statics, something the DetailsWidget can't do, since widgets don't export into static html, and I need to publish articles as static html.

Here is my new button text (which also makes the summary use the tiddler title):

<$button class="tc-btn-invisible"><$action-sendmessage $message="tm-new-tiddler" text="<details><summary><b><$view field='title'/></b></summary><span>

your text here

</span></details>" />{{$:/core/images/new-button}}</$button>

Obviously, your solution is more apt for most use cases. I am definitelty going to experiment with it, and add it to the toolmap. Mine is specifically for transcluding sections of a longer article, but as details elements. Enjoy.

Charlie Veniot

unread,
Mar 26, 2021, 11:35:29 PM3/26/21
to TiddlyWiki
G'day David,

I think I'm kind of simulating your process.

While editing a tiddler (say Tiddler A) and planning out content I'll eventuall transclude from some other at-the-moment non-existing tiddler (say Tiddler C), I'll enter in Tiddler A:

{{ Tiddler C | tAsDc }}.

tAsDc actually adds those two nice little icons (one of them being "open the transcluded tiddler".

If the tiddler doesn't exist, then clicking that wee button does the equivalent of pressing "+" (for a new tiddler), but with the tiddler name already there.  I love that kind of stuff. 

Reply all
Reply to author
Forward
0 new messages