Love it!

On Monday, October 7, 2019 at 2:27:54 AM UTC+3:30, TonyM wrote:
>
> Mohamad et al
>
> I nice little extencion to this is once the current tiddler is set, such 
> as inside the tiddler widget you can immediately make use of other items 
> such as buttons that operate on the current tiddler. One example is the 
> edit button;
>
> <$tiddler tiddler=<<currentTab>>
> ... normal tiddler content here ...
> {{||$:/core/ui/Buttons/edit}}
> </$tiddler>
>
> Note the "||" to make it a template applied to the currentTiddler.
>
> You will now have an edit tab tiddler button. This can be placed inside 
> the "tab template tiddler" or the "individual tabs tiddler". But you could 
> use this to provide clone, open in new window buttons etc...
>
> This highlights one of my strongest Tiddlywiki design principles, build 
> macros and solutions that "act on currentTiddler" wherever possible, even 
> if you provide an override parameter to pass another tiddler name.
>
> Regards
> Tony
>
> On Monday, October 7, 2019 at 8:23:24 AM UTC+11, Mohammad wrote:
>>
>> Thank you Eric!
>>
>> That's did the trick for me to keep my macro with default value of input 
>> parameter as currentTiddler!
>>
>> Cheers
>> Mohammad
>>
>> On Monday, October 7, 2019 at 12:46:09 AM UTC+3:30, Eric Shulman wrote:
>>>
>>> On Sunday, October 6, 2019 at 10:38:45 AM UTC-7, Mohammad wrote:
>>>>
>>>> I understood transclusion is inheritable.
>>>> On Sunday, October 6, 2019 at 8:08:56 PM UTC+3:30, Jeremy Ruston wrote:
>>>>
>>>>> The reason the content of Test01 displays differently in the tiddler 
>>>>> “Tabs Macro Example” is because the current tiddler is “Tabs Macro 
>>>>> Example”, which is inherited by the transcluded content of Test01. When 
>>>>> displaying Test01 on its own the current tiddler will be “Test01”.
>>>>>
>>>>
>>> A bit more clarification:
>>>
>>> When displaying tabs, the value of <<currentTiddler>> is dependent upon 
>>> the tiddler in which the tabset is rendered.  This allows you to use tabs 
>>> to show information related to that containing tiddler (e.g., the "info" 
>>> tabset displayed from the "more" menu for each tiddler shows information 
>>> about the tiddler containing that tabset).  However, for some use-cases, 
>>> the intention of the tabset is to simply show a set of tiddlers, where the 
>>> content of each tiddler is independent of the tabset in which they are 
>>> shown.
>>>
>>> Fortunately, there IS a way to achieve this, by using the <<currentTab>> 
>>> variable within the specific tab content, like this:
>>>
>>> <$tiddler tiddler=<<currentTab>>
>>> ... normal tiddler content here ...
>>> </$tiddler>
>>>
>>> When the above code is displayed directly (i.e., NOT within a tab), then 
>>> <<currentTab>> has *no value*, so the <$tiddler> widget does nothing, and 
>>> you get content using that tiddler's fields as the source.
>>>
>>> When the tiddler is displayed from within a tab, then the <<currentTab>> 
>>> value is the title of the source tiddler for that tab so you still get 
>>> content using that tiddler's field as the source.
>>>
>>> hope this helps,
>>>
>>> enjoy,
>>> -e
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5e9f29a0-1995-44b8-a094-15d79ca47837%40googlegroups.com.

Reply via email to