Joshua,

I think that explanation is useful.

The fact is I write most of my code with currentTiddler the target and use 
set or list to alter this value as needed.

I have being using the templating mechanism to great effect, using 
`{{||template}}` and relying on the context, ie currentTiddler is a common 
application. I have also developed solution where the context is set eg 
{{edit||$:/autotag}} will transclude all tiddlers tagged $:/autotag/edit 
and  {{edit||$:/autotag/actions}} will transclude all tiddlers tagged 
$:/autotag/actions/edit 
thus I can use actions={{edit||$:/autotag/actions}}, in these cases 
$:/autotag/actions/edit and $:/autotag/edit are sophisticated template 
tiddlers.

The issue is when I want to programmatically alter the "currentTiddler" 
used in the transcludes. There are half a dozen methods all of which 
complicate the code. eg a macro's etc...

All I am asking for is a native method to parameterise the long form, as we 
can with literals in the short form.

So it we keep the transclude widget as is but permit setting the 
currentTiddler in a parameter I could use the much simpler form using your 
terminology
<$transclude tiddler=<<transcludedtiddler>> context=<<currentContext>>/>

However the effort to persuade anyone on this simple "improvement" has 
being a little long winded. 

Regards
Tony


On Sunday, April 5, 2020 at 5:38:26 AM UTC+10, Joshua Fontany wrote:
>
> 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 tiddlywikidev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/a379dc9c-7bdc-435b-8c41-1eaed8b8e31b%40googlegroups.com.

Reply via email to