I believe it was originally intended so you could customize what is 
displayed inside the button.
But you can leverage it to execute actions inside the buttons as well.

in the tabs macro add the parameter for the buttonTemplate and point it 
towards a tiddler that you create to act as the template for the buttons. 
buttonTemplate:my-button-template
 
In the template tiddler place the following:
<!--- replace this comment with your actions -->
<$transclude tiddler=<<currentTab>> field="caption">
<$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/>
</$transclude>

You can wrap the actions in a list widget to make sure you execute the 
correct actions for the correct button.

On Thursday, July 2, 2020 at 7:51:10 PM UTC+2, Stobot wrote:
>
> I haven't, I saw it when trying to figure things out, but how would I use 
> it? Sorry for not understanding... I assumed would somehow allow me to 
> programmatically rename the tab or something?
>
> *buttonTemplate: Optionally, the title of a tiddler to use as a template 
> <https://tiddlywiki.com/#TemplateTiddlers> for transcluding the content of 
> the button for the selected tab* 
>
> On Thursday, July 2, 2020 at 1:37:10 PM UTC-4 [email protected] wrote:
>
>> Have you tried using the buttonTemplate parameter of the tabs macro?
>>
>>
>> On Thursday, July 2, 2020 at 7:28:57 PM UTC+2, Stobot wrote:
>>>
>>>
>>> My use case is that I have built a UI around the tabs macro, but some of 
>>> my tabs are lists of 'things', and then I have a tab for *viewing* the 
>>> thing, and one for *editing* the thing using drop downs etc. 
>>>
>>> What I ultimately need to happen is for some temp tiddlers to be deleted 
>>> when a certain tab is selected. I thought I might be able to either:
>>>
>>>    1. Add an actions parameter to the <<tabs>> macro to handle when 
>>>    it's changed
>>>    2. Put some raw <$action-...> code not behind a button and have it 
>>>    kind of work as a load event for that tiddler
>>>
>>> Neither seem to be possible. Is there some other similar functionality I 
>>> can use?
>>>
>>

-- 
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/e28df32f-e499-4d1b-a7a1-bc896535bcfbo%40googlegroups.com.

Reply via email to