HOWTO: Grabbing the prefix of a tiddler title to set "summary" on a DetailsWidget

59 views
Skip to first unread message

Charlie Veniot

unread,
Sep 21, 2020, 11:30:12 PM9/21/20
to TiddlyWiki
G'day all,

The following transcludes a tiddler called "Input Ports#️⃣Review EWSGLK" with a transclusion template called "tAsDetailsClosed".

{{Input Ports#️⃣Review EWSGLK||tAsDetailsClosed}}

"tAsDetailsClosed" takes care of:
  •  putting the transcluded tiddler within a Details Widget
  • setting the "Summary" of the Details Widget to the transcluded tiddler's title, but only whatever text is on the left side of the #️⃣ character.

"EWSGLK" is short for "ECO-WORTHY Solar Generator and Lighting Kit."

So "Input Ports#️⃣Review EWSGLK" = Input Ports hashtag Review of the ECO-WORTHY Solar Generator and Lighting Kit.

My  "ECO-WORTHY Solar Generator and Lighting Kit" "Aggregation Tiddler transcludes a whole bunch of tiddlers related to that product.  It doesn't make much sense to show the full titles of the transcluded tiddlers, so I scrub the extraneous stuff that comes after the  #️⃣.

BTW, here's the contents of the tAsDetailsClosed transclusion template:

<$details summary={{{ [all[current]split[#️⃣]!is[blank]nth[]] }}} >

<table style="border:none;width:100%;">
<tr>

<td style="border:none;width:95%">

{{!!text}}

</td>

<td style="border:none;text-align:right;width:5%">
<$link to={{!!title}}  tooltip="Open Transcluded Source Tiddler">🐟</$link>
</td>

</tr>
</table>

</$details>

Please find a screenshot below that shows the results.

BTW: I got this idea from TW Tones.  In this post, Tones showed how to add prefixes to tiddler names via filters.  That got me thinking about "scrubbing" suffixes via filters as a solution for scrubbing extraneous info from tiddler titles used as "Summary" values in DetailsWidgets.

Cheers !

HashtagScrubber.jpg







TW Tones

unread,
Sep 22, 2020, 7:58:27 PM9/22/20
to TiddlyWiki
Charlie,

Thanks for Sharing back.

Perhaps you should title post like this as [TIPS], I keep thinking you are ask for help instead of giving help.

I will just add;
  • After splitting a title rather than use nth[] you can use first[] for before the spilt, last[] for after.
  • I always have to say, try not to use compound tiddler names (I have argued at length why elsewhere), but your example is not too egregious in this case :)
I really like the idea to fashion a custom details widget from another value. 

Regards
Tones

Charlie Veniot

unread,
Sep 22, 2020, 9:27:20 PM9/22/20
to TiddlyWiki
That would be a language barrier.

Being a North-American English language speaker: "Howto" is akin to "Howto guide", or "Howto book".

Being French-Acadian with a somewhat creative and humorous bent, I'd be tempted to prefix requests for help with "Qu'est-ce qui diddley, là?" for the fun of it, likely "HowDoI" if I hope to seem less out to lunch.

For me, a tip is what I give to my food server.  

Fair warning to all:  French-Acadian, I'm more wordy than any of your grandma's, so hold onto your ears and brace yourselves for typically long-winded tiddler names from this verbose kid until my caboose gets bitten in a less-than-pleasing fashion.

Also, typically French-Acadian (well, in my mind): I can't talk without moving my hands.  So count yer lucky stars that I haven't yet figured out how to fit hand-movement into my tiddler titles and my writing in general... 

Giggles aside: I kind of liked "nth[]" as a consistent approach across the board for experimenting with this idea of multi-"qualified"(?)/"parameterized"(?)/??? tiddler names to unclutter my list of tags and field names.  Definitely going back to "first[]" (and last[] if I need it) if I'm not liking the experiment with nth[].  Well, one of many experiments on my plate ....
Reply all
Reply to author
Forward
0 new messages