How-to?: Make a button in the sidebar for multiple action-possibilities (like the "more actions")

141 views
Skip to first unread message

Surya

unread,
Feb 8, 2018, 3:33:54 PM2/8/18
to TiddlyWiki
Hi TW-friends :-)

I'd like to build a button in the sidebar (next to the other buttons) for building new tiddlers by templates.

But I want to have several possibilities for new-tiddler-templates in this button.
These should be choosable, when I click on this one button (like the "more actions"-button with the arrow-down).

Does anyone know how to do that?

Surya

TonyM

unread,
Feb 8, 2018, 10:55:51 PM2/8/18
to TiddlyWiki
Although not exactly the same you could create a menu button and display in top right bar using the MyMenus plugin.

Regards
Tony

Surya

unread,
Feb 9, 2018, 2:29:57 PM2/9/18
to TiddlyWiki
Hi Tony,

I had a look at it, and it seems to be very interesting :-))

I thought before, your plugin would increase the wiki a lot, but it is not so much :-)

I will try it- Thanks!
Surya

ste...@gmail.com

unread,
Feb 10, 2018, 5:24:39 PM2/10/18
to TiddlyWiki
Hi Surya,


On Thursday, February 8, 2018 at 9:33:54 PM UTC+1, Surya wrote:

I'd like to build a button in the sidebar (next to the other buttons) for building new tiddlers by templates.

But I want to have several possibilities for new-tiddler-templates in this button.
These should be choosable, when I click on this one button (like the "more actions"-button with the arrow-down).

I believe you could use the SelectWidget (simply define all desired actions within RevealWidgets in the "my-actions" macro):

\define my-actions()
<$reveal type="match" state="$:/state/SelectedOption" text="option1">
<$action-sendmessage $message="tm-notify" $param="SampleNotification"/>
</$reveal>
\end

<$select tiddler="$:/state/SelectedOption" actions=<<my-actions>>>
<option value="option1">Show Notification</option>
<option value="option2">My Second (Undefined) Action</option>
</$select>

You can try the code above on https://tiddlywiki.com/ 

Cheers,

Stef

Surya

unread,
Feb 10, 2018, 6:47:15 PM2/10/18
to TiddlyWiki
Hi Stef,

thanks for your answer!


I believe you could use the SelectWidget (simply define all desired actions within RevealWidgets in the "my-actions" macro):

\define my-actions()
<$reveal type="match" state="$:/state/SelectedOption" text="option1">
<$action-sendmessage $message="tm-notify" $param="SampleNotification"/>
</$reveal>
\end

<$select tiddler="$:/state/SelectedOption" actions=<<my-actions>>>
<option value="option1">Show Notification</option>
<option value="option2">My Second (Undefined) Action</option>
</$select>
But... I tried it- it didn't work, not with your example (not edited at all) and also not with my wanted.

I found now a solution with the MyMenu-Plugin from Tony.
And made a very different sidebar  as before the default one :-)

All the buttons you can choose to display on the page toolbar, I have unchecked now. They are not visible there anymore.
The save-wiki-button is now on the top-right-bar together with the MyMenu-buttons (the Jump-Menu, one menu-button for all new-tiddler-possibilities & one menu-button for the several buttons being before on the page toolbar.
I made the top-right-bar with margin-top to come more deeper- now that bar is on the same height as the search on the sidebar (unfortunately only optical, not in "real", because of that the search-field and the advanced-search-button doesn't move with the buttons /menus being on the top-right-bar).

With that solution a saved quite a lot space on the sidebar & it dosen't look anymore so "full with buttons" :-)
To see at http://surya-diy.tiddlyspot.com/

Surya
Sidebar mit MyMenus.jpeg

ste...@gmail.com

unread,
Feb 10, 2018, 7:08:34 PM2/10/18
to TiddlyWiki
Hi Surya, 


On Sunday, February 11, 2018 at 12:47:15 AM UTC+1, Surya wrote:
But... I tried it- it didn't work, not with your example (not edited at all) and also not with my wanted.

This is odd - it works fine when I paste my code into an empty tiddler on https://tiddlywiki.com/ (I didn't try to include it into the sidebar, though - this might be the biggest challenge).

Stef 

Surya

unread,
Feb 10, 2018, 7:17:50 PM2/10/18
to TiddlyWiki
Hi,

hmmm... Well, I want to be honest... I didn't spend long time with your suggestion, just tried it 2 times....

I am just almost happy with my solution with the MyMenus :-)

Surya

unread,
Feb 10, 2018, 7:19:52 PM2/10/18
to TiddlyWiki
I meant with "it doesn't work": I could choose the actions, but then nothing happened...

ste...@gmail.com

unread,
Feb 10, 2018, 7:26:23 PM2/10/18
to TiddlyWiki
On Sunday, February 11, 2018 at 1:19:52 AM UTC+1, Surya wrote:
I meant with "it doesn't work": I could choose the actions, but then nothing happened...

The first action requires the tiddler "SampleNotification", which exists on https://tiddlywiki.com/, but not in an empty wiki (I often use https://tiddlywiki.com/ as a playground, because it has some useful built-in tiddlers, and because anyone can access it). Maybe this was the reason why it didn't work? The second option doesn't do anything because no action is defined. 

Cheers,

Stef

Surya

unread,
Feb 10, 2018, 7:38:11 PM2/10/18
to TiddlyWiki
Okay, you're right :-)

I tried it before in my own wiki, on tiddlywiki.com it worked.

But, being honest- I will stay with MyMenus. But, if I will be one time not anymore satisfied with MyMenus I will come back to your solution :-)
Reply all
Reply to author
Forward
0 new messages