Input and output

80 views
Skip to first unread message

Chems

unread,
Jun 13, 2019, 12:20:19 PM6/13/19
to TiddlyWiki
Hey folks,

I want to create a list of tiddlers with two specific descriptions (descrption1, discription2).
So something like this:

<<list-links "[description1[vegetarian]description2[soup]]">>

This is showing me the correct tiddlers.

Now, I want to create two textfields, in which the user can type in the descriptions, e.g. vegetarian and soup, or vegan and corn, and get a list of the correct tiddlers.
Buy writing the following:

<input type="text">

I can create the textfield. But I am now not sure, how to combine the textfield, with the searching list feature. Anybody got an idea?

Thanks in advanced!

Mark S.

unread,
Jun 13, 2019, 2:17:36 PM6/13/19
to TiddlyWiki
This will get you started

''Meal type:'' <$edit-text tiddler="input1" tag="input"/> <br/>
''Course:'' <$edit-text tiddler="input2" tag="input" /> <br/>

<<list-links "[has[description1]has[description2]description1{input1}description2{input2}]">>

Generally, you don't want to use regular HTML tags for input fields. You want to use TW's own wikitext tags so you can leverage its power.

I assumed that you would need two edit boxes, since you have two categories. The first box stores the result in tiddler "input1". The second box stores the result in tiddler "input2". You can find  them in the "recent" column.

You can learn more about the EditTextWidget at https://tiddlywiki.com/#EditTextWidget .

Since people may not type in the right thing into the edit boxes, you may also want to look at the SelectWidget:


Instead of input edit boxes, this will let you present a drop-down list of options. Much less likely to create mistakes.

Good luck!

In the example

Chems

unread,
Jun 13, 2019, 4:21:15 PM6/13/19
to TiddlyWiki
Hey,

Thank you so much! That was reaaaly helpful!!
Do you know if its easily possible to show the fitting descriptions if I let one box empty?

example: 
If i wanna search for vegetarian and soup ill get 1 result
if i wanna search for vegetarian and pie ill get 1 result.

If i only search for vegetarian, and let the second field empty, ill get 2 results.

You know what I mean?

Again, Thank you very much!

Mark S.

unread,
Jun 13, 2019, 4:43:47 PM6/13/19
to TiddlyWiki
In that case, you problem want to use the "search operator" (https://tiddlywiki.com/#search%20Operator)

There are several ways to interpret what you want. This version assumes that you have just one input field, but
still have two description fields, and that you want results to return if either description field has a match:

<<list-links "[has[description1]search:description1{input1}] [has[description2]search:description2{input1}] ">>

good luck

Jed Carty

unread,
Jun 14, 2019, 5:30:14 AM6/14/19
to TiddlyWiki
While it isn't set to take input you type directly (there is a search function that is similar) I made a bookmarks plugin that has a similar mechanism and may be useful to you to take apart.
Reply all
Reply to author
Forward
0 new messages