How to add and delete two or more fields to the current tiddler using a viewtoolbar button

Based on the button shared by @JanJo in the above linked post for section editor, I want to create a viewtoolbar button to add and remove two fields in the current tiddler (instead of one field as seen in the section editor button)
Is that possible ? I was not able to do it using the setField option used in the button example given above.

Here is the code used in JanJo’s button for section editor

\whitespace trim
\define showsecs()
<$button setField="se-type" setTitle=<<currentTiddler>>  setTo=""  tooltip="showSections" aria-label="show-sections"class=<<tv-config-toolbar-class>>>
{{$:/images/icon-park/connect/intersection-outline}}
</$button>
\end
<$list filter="[all[current]fields[]search:title[se-type]]" emptyMessage=<<showsecs>>>
<$button tooltip="showSections" aria-label="show-sections"class=<<tv-config-toolbar-class>>>
<$action-deletefield $tiddler=<<storyTiddler>> $field="se-type" />
{{$:/images/icon-park/connect/intersection-fill}}
</$button>
</$list>

In the button widget, the parameters;
to, set, setTitle, SetField, setIndex, SetTo, popup message,

are all ways to add features to buttons for relatively simple outcomes, however you can do all these using other action widgets such as actionsetfield actionsendmessage either in the body or defined in a macro eg actions=<<myactionsmacro>>

So use the above button parameters when building simple function buttons.

  • Want to create more than one field and more? use the actions.