Added to TW-Scripts

Very nice tip!

If you have a look at TW-Utility, I have developed custom transclusion and 
I use them in TW-Scripts alot
See https://kookma.github.io/TW-Utility/#demo%2Ftransclusion-macro

--Mohammad

On Monday, March 16, 2020 at 7:25:54 AM UTC+3:30, TonyM wrote:
>
> Folks,
>
> I was looking through tiddlywiki to find how it does things because if you 
> are left on a desert island or isolated with corona virus and no internet, 
> tiddlywiki is in some ways its own documentation. I came across this in the 
> tiddler $:/core/templates/exporters/TidFile which piqued my interest.
>
> \define renderContent()
> {{{ $(exportFilter)$ +[limit[1]] ||$:/core/templates/tid-tiddler}}}
> \end
> \import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro
> ]!has[draft.of]]
> <<renderContent>>
>
> Already I often use the triple curly braces to get a quick filter result
>
> {{{ [all[]prefix[New Tiddler]] }}}
>
> Observe how the triple curly braces not only evaluates a filter but then 
> displays the result via a template?
>
> This is "documented" here 
> https://tiddlywiki.com/#Transclusion%20in%20WikiText but it is easy to 
> miss.
>
> {{{ [all[]prefix[New Tiddler]]||$:/core/ui/ListItemTemplate}}}
>
> For example the above uses the existing list item template to render the 
> list resulting from the filter, but it is no different to the default
>
> $:/core/ui/ListItemTemplate
> <div class="tc-menu-list-item">
> <$link to={{!!title}}>
> <$view field="title"/>
> </$link>
> </div>
>
> You can see how this template is quite simple;;
> And lets edit it to include the description
>
> Tiddlername Description
> <div class="tc-menu-list-item">
> <$link to={{!!title}}>
> <$view field="title"/>: {{!!description}}
> </$link>
> </div>
>
> Now you can use
> {{{ [all[]prefix[New Tiddler]]||Description}}}
>
> To list everything in the filter and its description if it exists.
>
> Or make the template DescriptionRow
> <tr><td><$link/></td><td>{{!!description}}</td></tr>
>
> And use
> <table>
> <tr><th>Name</th><th>Description</th></tr>
> {{{ [all[]prefix[New Tiddler]] ||DescriptionRow}}}
> </table>
>
> The possibilities abound.
> have fun
>
> Regards
> Tony
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b768c136-6d65-4acf-a296-551054f2612c%40googlegroups.com.

Reply via email to