<$list filter="[tags[]!is[system]sort[title]]" template="$:/plugins/tongerner/topmenu/menu-template" /><$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-untagged-label tc-tag-label">
Tags
</$button>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
<div class="tc-drop-down">
<$list filter="[tags[]!is[system]sort[title]]" template="$:/plugins/tongerner/topmenu/menu-template" />
</div>
</$reveal>
I have no issue listing all tags:<$list filter="[tags[]!is[system]sort[title]]" template="$:/plugins/tongerner/topmenu/menu-template" />But when I try to "nest" them inside button, I have issue. When clicked, the list shows, however it is not further clickable (i.e. when clicking on certain tag, the button "closes")<$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-untagged-label tc-tag-label">
Tags
</$button>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
<div class="tc-drop-down">
<$list filter="[tags[]!is[system]sort[title]]" template="$:/plugins/tongerner/topmenu/menu-template" />
</div>
</$reveal>What would be the best way to make such (at least two level) "pop-up tree":- level one, pop-up all tags (on button click)- level two, pop-up tiddler (on tag click)...of course, on tiddler click, I'd like to open it :)
<div class="tc-drop-down tc-popup-keep">
<$list filter="[tags[]!is[system]sort[title]]">
<$macrocall $name="tag" tag=<<currentTiddler>>/>
</$list>
</div>
<div class="tc-drop-down tc-popup-keep">
<$list filter="[tags[]!is[system]sort[title]]">
<$macrocall $name="tag" tag=<<currentTiddler>>/>
</$list>
</div>* by default, any click, whether inside or outside a popup, will dismiss the popup. This works well when the popup contents is just simple links. However, when further interaction is needed (i.e., when clicking a tag pill that shows a list of tags), you need to add "tc-popup-keep" to the drop-down class wrapper. Clicks *inside* the popup will then no longer dismiss the popup. Clicks *outside* the popup will still close it, as usual.* To show the tag pills rather than links to the tags themselves, use the $macrocall widget to invoke the <<tag>> macro, passing in the <<currentTiddler>> value (as set by the surrounding $list widget) as the desired tag name. The result is the display of a tag pill for each tag in your document.
<div class="tc-topmenu">
{{Tags button}}
{{Untagged button}}
{{Menu button}}
{{$:/core/ui/Buttons/new-tiddler}}
{{$:/core/ui/Buttons/control-panel}}
{{$:/core/ui/Buttons/close-all}}
{{SearchBar}}
</div><$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-untagged-label tc-tag-label">
Tags
</$button>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
<div class="tc-drop-down tc-popup-keep">
<$list filter="[tags[]!is[system]sort[title]]">
<$macrocall $name="tag" tag=<<currentTiddler>>/>
</$list>
</div>
</$reveal>
<$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-untagged-label tc-tag-label">
untgd
</$button>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
<div class="tc-drop-down">
<$list filter="[untagged[]!is[system]] -[tags[]] +[sort[title]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal><$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-untagged-label tc-tag-label">
Menu
</$button>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
<div class="tc-drop-down">
{{Menu button content}}
</div>
</$reveal>Now I am struggling to specify the width of the popup that opens, so that tags would be "width-wrapped" (see "Tags button" tiddler). Any hints?
"Tags button" tiddler:<$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-untagged-label tc-tag-label">
Tags
</$button>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
<div class="tc-drop-down tc-popup-keep">
<$list filter="[tags[]!is[system]sort[title]]">
<$macrocall $name="tag" tag=<<currentTiddler>>/>
</$list>
</div>
</$reveal>
.tc-drop-down { min-width: 400px; white-space: normal; }