Tony,
It took me a little while to wrap my head around how the short-form
`{{tiddler||template}}` is "rendered".
Basically, the <$transclude> widget, without a "parent" <$tiddler> widget
wrapped around it IS a "template widget" because anything transcluded will
use the "current" currentTiddler variable as its context.
Because in the short for the template parameter will default to the tiddler
parameter, it seems like we are "inserting" that tiddler all in one go, but
it is important to realize that it is "unpacked" to the nested structure:
<$tiddler tiddler="CONTEXT">
<$transclude tiddler="TEMPLATE"/>
</$tiddler>
Best,
Joshua Fontany
On Friday, April 3, 2020 at 12:26:44 AM UTC-7, TonyM wrote:
>
> Mario,
>
> The reason I did not suggest that was its not backwardly compatible, since
> the transclusion widget currently uses tiddler= to represent the tiddler to
> be transcluded and "defaults to currentTiddler".
>
> Jeremy,
>
> I have played with a few alternatives like macro's to do the equivalent
> and they are just not as convenient, we could say the transclusion widget
> defaults to current tiddler and we can't override this with a parameter
> unlike other widgets. If we had such a parameter I could set the effective
> currentTiddler without needing to resort to other code, which increases the
> complexity rapidly.
>
> I know transclusion may mean something subtly different to you, but for
> new and regular users it is to include the content from elsewhere. We are
> told the short form `{{||template}} or {{tiddlername||template}}` but the
> "widget form" is not available.
>
> Alternatively a new widget perhaps <$template [tiddler=tiddlername]
> template="templatetiddler" mode=block> when the default tiddlername is
> currentTiddler. New users hear the word template a lot, but its use is only
> in the short form of a transclude widget and is a parameter in other
> widgets.
>
> I will leave it to you, of course, but if you ever find yourself in that
> part of the code please consider this idea.
>
> Regards
> Tony
>
>
>
> On Thursday, April 2, 2020 at 11:50:17 PM UTC+11, PMario wrote:
>>
>> On Thursday, April 2, 2020 at 1:39:09 PM UTC+2, TonyM wrote:
>>>
>>> Jeremy
>>>
>>> That explains it well thanks. I still see value in being able to say
>>>
>>> <$transclude currentTiddler=tiddlername tiddler=templatetiddler/>
>>>
>>
>> I would name it: <$transclude tiddler=tiddlername
>> template=templatetiddler/> .... otherwise it would be very confusing for
>> users.
>>
>> eg: {{tiddlername||templatetiddler}} is the current structure and the
>> transclude widget reflect this, to make it easy to use.
>>
>> -mario
>>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywikidev/1b8a37a3-8fac-4cbf-9acb-9d157716afd0%40googlegroups.com.