Button to open infoToolbar on certain tab

124 views
Skip to first unread message

Danielo Rodríguez

unread,
Sep 1, 2016, 11:01:57 AM9/1/16
to TiddlyWiki
Hello,

I am here with a task that I though it would be easy, but it is driving me nuts.

I want to create a button that opens the info toolbar on certain tab. Sadly, due to the following characteristic of the qualify macro:

It returns a unique string that encodes its position within the widget tree

I can't target the same state tiddler from outside the info panel . So, the same qualify widget <<qualify "$:/state/tab">> returns two different things depending from where it is being called.

Any other option? It's setting the default tab my only option?

Mat

unread,
Sep 1, 2016, 11:14:29 AM9/1/16
to TiddlyWiki
Not-thought-through-idea; instead of qualifying "$:/state/tab", qualify something that also ncludes the tab title so that it is uniquely findable  ...?

<:-)

Jeremy Ruston

unread,
Sep 1, 2016, 12:37:44 PM9/1/16
to tiddl...@googlegroups.com
HI Danielo

In fact, the main view template computes the title for the state tiddler for the display state of the tiddler info panel and places it in the variable “tiddlerInfoState":


That variable is then picked up in the "title" view template segment that contains the info panel:


So, if your button is in the same tiddler as you want to display the info panel, then you’ll be able to use the “tiddlerInfoState” variable to target the state tiddler.

Best wishes

Jeremy



--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/18eecf21-58eb-446c-a712-78a291b81453%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
Sep 1, 2016, 5:07:19 PM9/1/16
to TiddlyWiki
In fact, the main view template computes the title for the state tiddler for the display state of the tiddler info panel and places it in the variable “tiddlerInfoState":


Hello Jeremy,

Isn't that for the state of the reveal? I mean, if the info area is folded or unfolded. 
The tiddlerInfo tiddler calls the tabs macro without any state parameter 



so the tabs macro fallback to the default one, $:/state/tabs

Maybe your intention was to set also a variable for the selected tab but you didn't ?

Regards

Jeremy Ruston

unread,
Sep 2, 2016, 3:17:15 AM9/2/16
to tiddl...@googlegroups.com
Hi Danielo

Isn't that for the state of the reveal? I mean, if the info area is folded or unfolded. 

You’re quite right, my apologies. If we want to have external control over the current tab of the tiddler info panel then we’d need to modify the master view template to apply the same technique to generating the name of the info panel tab state tiddler.

Best wishes

Jeremy.


The tiddlerInfo tiddler calls the tabs macro without any state parameter 



so the tabs macro fallback to the default one, $:/state/tabs

Maybe your intention was to set also a variable for the selected tab but you didn't ?

Regards

--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

PMario

unread,
Sep 2, 2016, 3:24:02 AM9/2/16
to TiddlyWiki
Hi Danielo,

I do have some small plugins that may do what you want. I just need to include them into editions and push them to github.
A little bit of docs is needed too. Expect more info soon.

-mario

Danielo Rodríguez

unread,
Sep 2, 2016, 3:34:55 AM9/2/16
to TiddlyWiki
Hello!

Mario, thank you for that! I can't wait to see what you have. Please inform me as soon as you release it.

Jeremy, again thank you for confirmation. Do you think it would be a good idea to implement the same mechanism? From my point of view it is, but I want go know your opinion.

Jeremy Ruston

unread,
Sep 2, 2016, 3:42:59 AM9/2/16
to tiddl...@googlegroups.com
Hi Danielo

> Jeremy, again thank you for confirmation. Do you think it would be a good idea to implement the same mechanism? From my point of view it is, but I want go know your opinion.

I’d actually tackle it slightly differently, by retaining the current definition of “tiddlerInfoState” and changing $:/core/ui/ViewTemplate/title to append a qualifier “-open” to the value of tiddlerInfoState as the title of the state tiddler specifically for the open/close state, and then changing $:/core/ui/TiddlerInfo to use the same technique to generate a state tiddler for the current tab.

Best wishes

Jeremy


>
> --
> 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 tiddlywiki+...@googlegroups.com.
> To post to this group, send email to tiddl...@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/299d444d-f9b3-45dd-9472-9d76528b72c1%40googlegroups.com.

PMario

unread,
Sep 2, 2016, 5:36:07 AM9/2/16
to TiddlyWiki
On Friday, September 2, 2016 at 9:42:59 AM UTC+2, Jeremy Ruston wrote:
I’d actually tackle it slightly differently, by retaining the current definition of “tiddlerInfoState” and changing $:/core/ui/ViewTemplate/title to append a qualifier “-open” to the value of tiddlerInfoState as the title of the state tiddler specifically for the open/close state, and then changing $:/core/ui/TiddlerInfo to use the same technique to generate a state tiddler for the current tab.

Hi Jeremy,
You may remember my presentation from the Oxford meetup. I do have the exact functionality, that Danielo wants. I use it with the "tagMap" plugin, which instead of opening a dropdown if you click on tag pills, it opens the info panel and the tagMap tab.

The tricky thing her is, that all names need to be predictable. So the existing qualify macro to create state names can't be used. ...

As I wrote. I need some time to push it to github.

-m

PMario

unread,
Sep 3, 2016, 5:49:10 PM9/3/16
to TiddlyWiki
On Thursday, September 1, 2016 at 5:01:57 PM UTC+2, Danielo Rodríguez wrote:
I want to create a button that opens the info toolbar on certain tab. Sadly, due to the following characteristic of the qualify macro:

I did publish a tiddlywiki at wikilabs.github.io

It contains the functionality that I demoed at the eu-meetup. It is a very opinionated "beta" editon, that contains some of my TW modifications. I did try to make them as "generic" as possible. see: https://github.com/wikilabs themes, plugins, editions repos for more info.


It returns a unique string that encodes its position within the widget tree

I can't target the same state tiddler from outside the info panel . So, the same qualify widget <<qualify "$:/state/tab">> returns two different things depending from where it is being called.

As you found out the <<qualify ...>> macro creates (for humans) unpredictable state names. So if you want to set a state from "somewhere" you'll need a dynamically created, but predictable name. I did this with my tag pills.

So if you click a tag pill, it will open the tiddler info section and the corresponding "Tag Map" tab.

For this behaviour you'll need some major changes to some ViewTemplate elements.

This link, will open the different tiddlers, that are involved, to provide the needed functionality.

 - 01-slant-01-theme ... is a theme that can be selected. So you can enable / disable the functions with the default theme switcher.

 - $:/wikilabs/macros/tabs-state .. is a modified tabs macro, that allows you to set the selected tab from outside

 - $:/core/ui/TiddlerInfo ... calls the above tab-state macro

 - $:/core/ui/ViewTemplate ... contains 2 new variable definitions for "tiddlerInfoState". see the first 2 \define statements

 - $:/core/ui/TagTemplate ... contains the buttons to activate the stuff. \define tag-body-inner() contains 2 <$action-setfield widgets that activate the info area and select the right tab.

if you have questions, just ask.

have fun!
mario


Reply all
Reply to author
Forward
0 new messages