How to show a toolbar button *only" in tiddlers tagged with some tag?

65 views
Skip to first unread message

Måns

unread,
May 23, 2015, 3:56:18 PM5/23/15
to tiddl...@googlegroups.com
Hi TwWizards

I'm trying to hide a toolbar button from all tiddlers *not* tagged with: "vislisteknap" using the list filter widget.
If no tiddlers are tagged with "vislisteknap" it *is* hidden - however if I tag just one tiddler with "vislisteknap" the button i visible in all tiddlers...


Cheers Måns Mårtensson

ExecuteListOfTitles:

\define listButtonTags()
[[$(currentTiddlerTag)$]] $(listButtonTags)$
\end
\define listButton()
<$list filter="[tag[vislisteknap]]">
<$button tooltip='make new tiddlers from list - ONLY lists!!' class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-button}}{{$:/core/images/new-button}}
</$list>
<$list filter={{!!text}}>
<$action-setfield $tiddler={{!!title}} text="Kontaktgruppe: [[$(currentTiddlerTag)$]]" tags="$(listButtonTags)$" kontaktgruppe="$(currentTiddlerTag)$"/>
</$list>
</$button>
</$list>
\end
<$set name="listButtonTags" value={{ExecuteListOfTitles!!tagtemplate}}>
<$set name="currentTiddlerTag" value=<<currentTiddler>>>
<<listButton>>
</$set>
</$set>

Måns

unread,
May 23, 2015, 4:06:55 PM5/23/15
to tiddl...@googlegroups.com
An interesting thing to observe is the fact that when you click the toolbar button - only the list of the tiddler which is tagged with: "vislisteknap" is executed - however the tag (<<currentTiddler>>) and also the custom field "kontaktgruppe" (also <<currentTiddler>>) will change depending on which tiddler you invoked/clicked the toolbar button...

Maybe this behaviour is useful in another context?

Cheers Måns Mårtensson
Reply all
Reply to author
Forward
0 new messages