Selecting txt option values from a list

9 views
Skip to first unread message

Anthony Muscio

unread,
Jul 21, 2008, 10:40:57 PM7/21/08
to TiddlyWiki
Some more assistance from the Gurus Please,

Is there a way to select a value to assign to a particular option
based on tags ?

Eg;
I have an option set to indicate my current project;
With various plugins installed;

I can display it using
|Project|<<message options.txtCurrentProject>>|

I can add it to macros such as;
<<tiddler !.ListCurrentat with: {{config.options.txtCurrentProject}}
>>

I can manually type in the value
<<option txtCurrentProject>>

How can I select the value to assign to txtCurrentProject from a set
of tiddlers tagged "#"

tiddler Name Tags
Project1 #
Project2 #
Project3 #

I want a macro that can present the title of all tiddlers tagged # as
a possible value for the txtCurrentProject.
Once selected the selected tiddlers title will become the vale of
txtCurrentProject.

eg
txtCurrentProject=Project2

Thanks in advance, TonyM

Anthony Muscio

unread,
Jul 23, 2008, 1:49:10 AM7/23/08
to TiddlyWiki
Self Resolved as follows;

Using ListboxPlugin

Use the following select command
<<select fieldname rows:1 *.listProjects>>

where the tiddler
.listProjects
contains the necessary foreachtiddler command to list all tiddlers
with the projects tag

Note the trick here is to use the * in *.listproject to
render .listproject before the select is used.

TonyM



Eric Shulman

unread,
Jul 23, 2008, 2:28:22 AM7/23/08
to TiddlyWiki
> Using ListboxPlugin
> <<select fieldname rows:1 *.listProjects>>
> .listProjects
> contains the necessary foreachtiddler command to list all tiddlers
> with the projects tag

Rather than using <<forEachTiddler>>, the <<select>> macro provides a
built-in syntax for listing tiddlers based on a given tag...
<<select fieldname rows:1 =projects>>
where the "=projects" syntax generates a list containing the titles of
all tiddlers that are tagged with "projects".

Also, if you use "=cookiename" in place of the fieldname, the selected
value will be stored as a global TW option cookie rather than using a
custom tiddler field in the current tiddler.

Thus:
<<select =CurrentProject rows:1 =projects>>
creates a droplist of all tiddlers that are tagged with projects and,
when a selection is made, it stores the selected tiddler title in an
internal config variable called:
config.options.txtCurrentProject
which is also automatically saved as a browser-based option cookie
called:
txtCurrentProject

Note: the "=cookiename" syntax was just added to the plugin today, so
you might want to get the update to the most recent release (v1.1.0):
http://www.TiddlyTools.com/#ListboxPlugin
http://www.TiddlyTools.com/#ListboxPluginInfo

enjoy,
-e

Anthony Muscio

unread,
Jul 23, 2008, 4:11:36 AM7/23/08
to TiddlyWiki
Thanks,

That is exactly what I need, thank you !

However perhaps against my better judgment I have two tag values I
really care about;
all my projects are tagged # - this works well
my working "modes" are tagged : - this works well

I have other special character tags as well, most distressing one is =

So this
<<select =CurrentStatus rows:1 ==>>
this does not work

Should I simplify my tags naming or can you tell me a way to get
around this ?

Thanks Eric,
Yippee !
Reply all
Reply to author
Forward
0 new messages