addendum: When used as a shortcut, I'm not sure that the macro definition for the config tiddler title will be available. If this is the case, then you can also write it this way: <$vars config="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit"> <$action-setfield $tiddler=<<config>> text={{{ [<config>get[text]!match[show]then[show]else[hide]] }}}/> </$vars>
-e On Saturday, June 12, 2021 at 2:50:15 PM UTC-7 Eric Shulman wrote: > On Saturday, June 12, 2021 at 12:54:54 PM UTC-7 atulg...@gmail.com wrote: > >> I am trying to add a shortcut... I don't know what the first line of the >> code should be... Please help. >> > > Try this: > <$list > filter="[[$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit]get[text]!match[show]]" > > emptyMessage=""" > <$action-setfield > $tiddler="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit" > text="hide"/>"""> > <$action-setfield > $tiddler="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit" > text="show"/> > </$list> > > Notes: > * if the config tiddler does not exist or has content matching "show", > then the "hide" action is performed > * otherwise the "show" action is performed > > Also, you can make the code more compact, by defining the config tiddler > title using a macro > and using a filtered transclusion instead of a $list widget to set the > content to show or hide, like this: > \define config() > $:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit > <$action-setfield $tiddler=<<config>> text={{{ > [<config>get[text]!match[show]then[show]else[hide]] }}}/> > > 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9856c3f2-7e1c-45f2-8c28-1093415bb461n%40googlegroups.com.