I'm trying to add an action to the following button set that is currently functional:
\define yesnotag()
<$fieldmangler><$button message="tm-add-tag" param="Yes">{{$:/core/images/new-button}}</$button>
<$button message="tm-remove-tag" param="Yes">{{$:/core/images/delete-button}}</$button></$fieldmangler>
\end
This, when you add "<<yesnotag>> to a tiddler has a "+" sign button that adds a "Yes" tag to the tiddler and a (garbage can) button that removes the "Yes" tag.
The added functionality I want is for a certain SideBar tab to open if its not already open.
The following does just that in a separate button:
<$button> open "Homework" tab
<$action-setfield $tiddler="$:/state/tab/sidebar--1835078512" text="Homework">
</$button>
It opens the "Homework" tab in the sidebar
My question is this: How can I get the sidebar tab "Homework" to open when you click either the buttons from the first <<yesnotag>> macro?
I've tried adding
<$action-setfield $tiddler="$:/state/tab/sidebar--1835078512" text="Homework">
in all the possible places in that macro I can think of and it always breaks the functionality of the original buttons, usually getting rid of the button image.
I suspect this might be one of those instances where there's more than one way to achieve something and I'm trying to combine them in the wrong way...
Is there a way to do this?
Thanks,
- Dave