Need dropdown to open tiddlers

140 views
Skip to first unread message

David Gifford

unread,
Aug 23, 2020, 11:41:45 AM8/23/20
to TiddlyWiki

Hi all

The documentation on tiddlywiki.com for the select widget neglects to include an example of the most obvious use case for such a widget: a dropdown list of links to tiddler titles that one can use to open one of the titles in the dropdown list.

How could I convert the example below, grabbed from the documentation, into what I need? I am guessing I need to integrate the action navigate widget, but am not sure how. Any help?

<$select tiddler=<<qualify 'select-demo'>> default='HelloThere'> <$list filter='[all[shadows+tiddlers]tags[]sort[title]]'> <option value=<<currentTiddler>>><$view field='title'/></option> </$list> </$select>

Mat

unread,
Aug 23, 2020, 11:50:04 AM8/23/20
to TiddlyWiki
If I understand you right, you want the displayed titles to be links as opposed to just textual titles. But the SelectWidget is not used for this, it is used to select an item to set a field value. If you want a list with links to show, you should use the revealwidget. If you *also* want to set a field value as you click the link, then this is doable but a tad more complex so I won't describe it unless you ask.

<:-)

David Gifford

unread,
Aug 23, 2020, 12:02:37 PM8/23/20
to tiddl...@googlegroups.com
okay thanks Mat, I will try the RevealWidget. Blessings.




On Sun, Aug 23, 2020 at 10:50 AM Mat <matia...@gmail.com> wrote:
If I understand you right, you want the displayed titles to be links as opposed to just textual titles. But the SelectWidget is not used for this, it is used to select an item to set a field value. If you want a list with links to show, you should use the revealwidget. If you *also* want to set a field value as you click the link, then this is doable but a tad more complex so I won't describe it unless you ask.

<:-)

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/UJzCgfHZ_sg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/53e2f537-6312-432b-ba9a-6dc8bf51c0beo%40googlegroups.com.

Eric Shulman

unread,
Aug 23, 2020, 12:26:22 PM8/23/20
to TiddlyWiki
On Sunday, August 23, 2020 at 8:41:45 AM UTC-7, David Gifford wrote:
...a dropdown list of links to tiddler titles that one can use to open one of the titles...
...I am guessing I need to integrate the action navigate widget, but am not sure how...

<$vars selection=<<qualify $:/temp/goto>>>
<$select tiddler=<
<selection>> actions="<$action-navigate $to={{{ [<selection>get[text]] }}}/>">
   <$list filter='[all[tiddlers]sort[title]]'>
     
<option><<currentTiddler>></option>
   </$list>
</$select>
</$vars>

Note: the actions="..." is only performed when the selection *changes*.  Thus, if you already have a current selection in the list, clicking it will do nothing.

enjoy,
-e

Eric Shulman

unread,
Aug 23, 2020, 12:41:38 PM8/23/20
to TiddlyWiki
On Sunday, August 23, 2020 at 8:41:45 AM UTC-7, David Gifford wrote:
...a dropdown list of links to tiddler titles that one can use to open one of the titles...
...I am guessing I need to integrate the action navigate widget, but am not sure how...
 
Here's a different solution, using a popup $reveal with $buttons:
<$button popup=<<qualify $:/temp/goto>>> goto </$button>
<$reveal type="popup" state=<
<qualify $:/temp/goto>>
   class="tc-drop-down" style="min-width:auto;max-height:10em;overflow-y:scroll;">

   <$list filter='[all[tiddlers]sort[title]]'>
      <$button class="tc-btn-invisible" to=<<currentTiddler>>>
         <$text text=<
<currentTiddler>>/>
      </$button>
   </$list>
</$reveal>

Notes:
1) Unlike the $select solution, this method doesn't remember the selection, so clicking always goes to the tiddler.
2) Adjust the style="..." attributes to suit your needs.  Specifically, you can set a different max-height value.

enjoy,
-e

David Gifford

unread,
Aug 23, 2020, 1:30:09 PM8/23/20
to tiddl...@googlegroups.com
Thanks Eric I will try that, too

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/UJzCgfHZ_sg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

David Gifford

unread,
Aug 23, 2020, 7:26:05 PM8/23/20
to TiddlyWiki
Just a note to say I got it working the way I want it, using a slight adaptation of Eric's second snippet. Thanks Mat and Eric!

Eric Shulman

unread,
Aug 23, 2020, 8:05:54 PM8/23/20
to tiddl...@googlegroups.com
On Sunday, August 23, 2020 at 9:41:38 AM UTC-7, Eric Shulman wrote:
Here's a different solution, using a popup $reveal with $buttons:
<$button popup=<<qualify $:/temp/goto>>> goto </$button>
<$reveal type="popup" state=<
<qualify $:/temp/goto>>
   class="tc-drop-down" style="min-width:auto;max-height:10em;overflow-y:scroll;">
   <$list filter='[all[tiddlers]sort[title]]'>
      <$button class="tc-btn-invisible" to=<
<currentTiddler>>>
         <$text text=<
<currentTiddler>>/>
      </$button>
   </$list>
</$reveal>
 
Even more compact version:
<$button popup=<<qualify $:/temp/goto>>> goto </$button>
<$reveal type="popup" state=<
<qualify $:/temp/goto>

   class="tc-drop-down" style="min-width:auto;max-height:10em;overflow-y:scroll;">
   <$list filter='[all[tiddlers]sort[title]]'><$link /></$list>
</$reveal>

-e

TW Tones

unread,
Aug 23, 2020, 10:59:32 PM8/23/20
to TiddlyWiki
Eric,

The compact version did not work for me on tiddlywiki.com, however the previous does.

Can you tell me how to get the contents of the popup to open towards the left rather than the right?
  • If you move this to the $:/tags/ViewToolbar its not so elegant.
Thanks for you answers!

Regards
Tones

Eric Shulman

unread,
Aug 23, 2020, 11:08:06 PM8/23/20
to TiddlyWiki
On Sunday, August 23, 2020 at 7:59:32 PM UTC-7, TW Tones wrote:
The compact version did not work for me on tiddlywiki.com, however the previous does.

It works for me on TiddlyWiki.com.  GoogleGroups has a bad habit of adding newlines where they don't belong. Perhaps that's what happened here. 
 
Can you tell me how to get the contents of the popup to open towards the left rather than the right?

add position="belowleft" to the $reveal widget

-e

TW Tones

unread,
Aug 23, 2020, 11:27:34 PM8/23/20
to TiddlyWiki
So easy thanks

I must return to the reveal widget again, because I usualy get what I want from a list widget, but not here with popups.

<$button popup=<<qualify $:/temp/goto>>> goto </$button>
<$reveal type="popup" state=<
<qualify $:/temp/goto>>
   class="tc-drop-down" style="min-width:auto;max-height:10em;overflow-y:scroll;">
   <$list filter='[all[tiddlers]sort[title]]'><$link /></$list>
</$reveal>

I repaired compact version, an unwanted line break at the end of the 2nd `<<qualify $:/temp/goto>>` fixed.

Regards
Tones

Regards
Tones
Reply all
Reply to author
Forward
0 new messages