Thanks Eric.... Works beautifully... YOU ARE THE MAN!
On Sunday, June 13, 2021 at 3:23:55 AM UTC+5:30 Eric Shulman wrote:
> 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 [email protected] 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/92c6ee3e-f7f5-4456-b79e-e30fcc155b31n%40googlegroups.com.