So, basically you want to select the search. TiddlyWiki gives you a way to
make those kind of choices. It's the select widget.
Here we're back to using the search box on the side. Paste this into INDEX
or wherever you want:
<$select tiddler="$:/temp/searchfilter" default="Choose">
<option value="Choose">-Choose one-</option>
<option value="[has[intelligence]search:intelligence{$:/temp/search}]">
Intelligence</option>
<option value="[has[climate_terrain]search:climate_terrain{$:/temp/search}]"
>Climate/Terrain</option>
<option value="[has[hd]search:hd{$:/temp/search}]">HD</option>
</$select>
<$macrocall $name="list-links" filter={{$:/temp/searchfilter}} />
The "macrocall" is invoking the list-links macro in a way that allows us to
pass in the results of the selection.
The selection creates a drop-down list. You can pick whatever search you
want and that's how the contents of the search box will be used. You can
hopefully see how the filter for each option choice is made. You can copy
the existing options and tweak them to match other search criteria as you
add fields to your data and searches.
As always make backups!
HTH
-- Mark
On Thursday, October 4, 2018 at 4:14:46 PM UTC-7, PWL wrote:
>
> That is a great start Mark. I guess I wasn't clear enough. I need to be
> able to search each field individually. I am really not concerned with
> having a match in all three at once, just which ever one I am looking for
> at the time. If you would like access to my data I can send it too you.
> or post a cap of the tiddler code here.
>
> On Thursday, 4 October 2018 19:47:30 UTC-3, Mark S. wrote:
>>
>> Since you're searching on 3 things, you need 3 search fields. This means
>> you'll need custom search input boxes. Put the following in a tiddler
>> (possibly in your INDEX tiddler):
>>
>> Intelligence: <$edit-text tiddler="$:/temp/intelligence" tag="input"
>> size=10 placeholder="Intel"/> <br/>
>>
>>
>> Also make an empty tiddler with the title $:/temp/intelligence. Hopefully
>> you can see how this works. You need a separate tiddler for each aspect
>> that you want to search. Copy the line and "intelligence" (and "Intel") as
>> appropriate for each dimension. So you might end up with:
>>
>> Intelligence: <$edit-text tiddler="$:/temp/intelligence" tag="input"
>> size=10 placeholder="Intel"/> <br/>
>> Climate/terrain: <$edit-text tiddler="$:/temp/climate_terrain"
>> tag="input" size=10 placeholder="Cli/Ter"/> <br/>
>> HD: <$edit-text tiddler="$:/temp/hd" tag="input" size=10
>> placeholder="HD"/> <br/>
>>
>>
>> And now your search (without the complication of minimum length) might
>> look like:
>>
>> <<list-links
>> "[has[intelligence]search:intelligence{$:/temp/intelligence}has[climate_terrain]search:climate_terrain{$:/temp/climate_terrain}has[hd]search:hd{$:/temp/hd}]">>
>>
>> This will match exclusively for all 3 items. That is, all 3 items have to
>> match before any search results show. Note that an empty search field will
>> probably be seen as "all matches" so you may see an all-up listing at first
>> (because we've stripped out the minlength detection).
>>
>> Check my work for spelling and name consistencies -- I haven't tested any
>> of this. Writing up stuff takes time and testing takes even more when you
>> don't have a data source handy.
>>
>> Note that for fields that have simple, direct values (like "15") then you
>> can use filter items like "category[15]" which is more precise than using
>> search. But if your field has multiple values (like "Average (10-12)") then
>> you need to use something like the "search" operator.
>>
>> Good luck!
>> -- Mark
>>
>>
--
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 [email protected].
To post to this group, send email to [email protected].
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/04c23cf7-60c5-442f-b1c7-eb857b7485d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.