How to do a "clone" of $:/core/ui/Buttons/more-page-actions

I apologize for the question which I think is quite stupid, but I’m puzzled. Currently I have too many buttons in the page toolbar, so I thought of making a couple of clones of $:/core/ui/Buttons/more-page-actions so as to have all the functionalities well ordered, but without taking up too much space.

So I started by taking $:/core/ui/Buttons/more-page-actions and making a copy. And I thought, I change the filter that is to find the content of $:/core/ui/Buttons/more-page-actions and put my own to find the buttons I want in that, for example a filter like [tag[MoreActions2]].

Now, this didn’t quite work out as well as I’d hoped. But, and here I’m puzzled, for some reason the same filter worked at some point with one of the buttons I wanted to tag (I don’t know why and I unfortunately haven’t been able to replicate it). I could change my approach, but since I think I’ve glimpsed the solution (and because at the moment I have no idea how to do it any other way), I thought I’d ask.

  • Changing the filter in a way like this would work? (Exactly as I wrote it I’m afraid not because I already tried it and it doesn’t work, but I mean, in a similar way to that) Or is it better to try another way?

The piece of code in question (where I would change the filter and nothing else):
Before:
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" variable="listItem">
After:
<$list filter="[tag[MoreActions2]!has[draft.of]]" variable="listItem">


Full code of $:/core/ui/Buttons/more-page-actions, for reference:

\whitespace trim
\define config-title()
$:/config/PageControlButtons/Visibility/$(listItem)$
\end
<$button popup=<<qualify "$:/state/popup/more">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/down-arrow}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$list>
</$button><$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes">

<div class="tc-drop-down">

<$set name="tv-config-toolbar-icons" value="yes">

<$set name="tv-config-toolbar-text" value="yes">

<$set name="tv-config-toolbar-class" value="tc-btn-invisible">

<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" variable="listItem">

<$reveal type="match" state=<<config-title>> text="hide">

<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">

<$transclude tiddler=<<listItem>> mode="inline"/>

</$set>

</$reveal>

</$list>

</$set>

</$set>

</$set>

</div>

</$reveal>

I am building buttons at the moment and they are foremost in my mind, what you are asking for is a good generic solution, so perhaps I will just make one and share, rather than respond to your particular code?

  • Is that OK?
    • You can then examine my tiddlers
    • I have already done this once for page controls and multiple times for the view template.
1 Like

Here is a package that provides an even more Pages Control AND View Tool bar button which you can add and remove what appears with a tag;

See Control Panel > Appearance > Toolbars

even-more-buttons.json (12.0 KB)

  • Rigorous testing has not being done
  • Comments and feedback appreciated.

The included tiddlers $:/PSaT/Buttons/even-more/page-actions and $:/PSaT/Buttons/even-more/tiddler-actions are examples to support the Original Topic OT. They we cloned from existing more buttons and modified.

1 Like

Sorry for the late response. That wasn’t exactly what I was asking for, but maybe I can find something better in what you gave me. Thank you. I’ll take a look and see what I can do

:ok_hand:t2:

I don’t know what feedback to give because, really, it’s perfect. Really good (and btw solves my issue perfectly, thanks)

Edit:
Looking again there’s actually a flaw: I can’t change the order inside the dropdown, no matter the order in the manager

1 Like

The order depends usually with the tag, select the tag pill on one of the items and drag and drop reorder.

  • If the dropdown is not responding we need to ensure it is NOT Sorting.

I may be off line this weekend