[TW5] - Tooltip text on tabs?

181 views
Skip to first unread message

leeand00

unread,
Dec 18, 2015, 2:21:37 PM12/18/15
to TiddlyWiki
In the TW4 version of the tabs macro you could specify a tooltip for a tab.  Is there a field you can set that will do the same thing in TW5?

Tobias Beer

unread,
Dec 18, 2015, 4:59:03 PM12/18/15
to TiddlyWiki
Hi leeand00,
 
In the TW4 version of the tabs macro you could specify a tooltip for a tab.  Is there a field you can set that will do the same thing in TW5?

Nope, but creating a modified version of the core tabs macro is rather simple...


Simply add the tooltip parameter at the end and then set the tooltip attribute for the button(s) accordingly.

Best wishes,

Tobias.

Jeremy Ruston

unread,
Dec 23, 2015, 8:17:36 AM12/23/15
to tiddl...@googlegroups.com
Hi Tobias

> Nope, but creating a modified version of the core tabs macro is rather simple

I’d be glad to receive a pull request to add tooltips to the core tabs macro.

Best wishes

Jeremy.

Matabele

unread,
Dec 23, 2015, 9:21:26 AM12/23/15
to tiddl...@googlegroups.com
Hi

That would give the same tooltip for all tabs, if I'm not mistaken. A field will be required in each tab tiddler with differing values (much like the caption field) -- to which the button tooltip refers.

And I've had problems in the past passing a reference correctly to a tab :-/

regards

Matabele

unread,
Dec 23, 2015, 12:22:12 PM12/23/15
to TiddlyWiki
Hi Jeremy

Can't get this to work without changing the <<currentTab>> variable to <<currentTiddler>> -- in order that the field reference {{!!tooltip}} brings in the value for that tab. The following seems to work -- is there some reason for the choice of <<currentTab>> rather than the default <<currentTiddler>>?

\define tabs(tabsList,default,state:"$:/state/tab",class,template)
<div class="tc-tab-set $class$">
<div class="tc-tab-buttons $class$">
<$list filter="$tabsList$">
<$button set=<<qualify "$state$">> setTo=<<currentTiddler>> default="$default$" selectedClass="tc-tab-selected" tooltip={{!!tooltip}}>
<$set name="tv-wikilinks" value="no">
<$transclude field="caption">
<$macrocall $name="currentTiddler" $type="text/plain" $output="text/plain"/>
</$transclude>
</$set>
</$button>
</$list>
</div><div class="tc-tab-divider $class$"/><div class="tc-tab-content $class$">
<$list filter="$tabsList$">

<$reveal type="match" state=<<qualify "$state$">> text=<<currentTiddler>> default="$default$">

<$transclude tiddler="$template$" mode="block">

<$transclude mode="block"/>

</$transclude>

</$reveal>

</$list>
</div>
</div>
\end

regards

Jeremy Ruston

unread,
Dec 23, 2015, 12:23:55 PM12/23/15
to tiddl...@googlegroups.com
Hi Matabele

On 23 Dec 2015, at 17:22, Matabele <matabe...@gmail.com> wrote:

is there some reason for the choice of <<currentTab>> rather than the default <<currentTiddler>>?

It’s important that the tabs macro doesn’t change the current tiddler - think of contexts like the info panel, where each tab references the current tiddler.

Best wishes

Jeremy.

Matabele

unread,
Dec 23, 2015, 12:33:35 PM12/23/15
to TiddlyWiki
Hi Jeremy

OK -- the same problem occurs with buttons -- if one sets the currentTiddler with an enclosing $tiddler widget -- all field references point to this tiddler.

Struggling to reference the 'tooltip' field of each tab in the macro -- tried setting variables and using macros to access {{<<currentTab>>!!tooltip}}, without success. Either references the wrong tiddler (usually currentTiddler), or returns the TextReference string rather than the contents of the TextReference.

I'm sure I eventually solved this one, but can't lay my hands on the solution (it was some time ago.)

regards

Matabele

unread,
Dec 23, 2015, 12:36:46 PM12/23/15
to TiddlyWiki
Hi Jeremy

Strange thing is -- this seems to work on tiddlywiki.com. Can't find any instance where my version fails.

regards

On Wednesday, 23 December 2015 19:23:55 UTC+2, Jeremy Ruston wrote:

Jeremy Ruston

unread,
Dec 23, 2015, 12:37:59 PM12/23/15
to tiddl...@googlegroups.com
Hi Matabele

On 23 Dec 2015, at 17:33, Matabele <matabe...@gmail.com> wrote:

Struggling to reference the 'tooltip' field of each tab in the macro

It’s dirty, but you may need to explicitly preserve and restore the current tiddler so that you’re able to use it to transclude the tooltip value.

Best wishes

Jeremy
Message has been deleted

Matabele

unread,
Dec 23, 2015, 2:06:41 PM12/23/15
to tiddl...@googlegroups.com
Hi Jeremy

I have moved this discussion over to Github -- pull request here: https://github.com/Jermolene/TiddlyWiki5/pull/2147

Could someone else test this out? Can't see any problems on tiddlywiki.com

regards

On Wednesday, 23 December 2015 15:17:36 UTC+2, Jeremy Ruston wrote:
Reply all
Reply to author
Forward
0 new messages