[tw5] Re: Using data dictionary for variable lookup

2019-02-05 Thread Chris Brouwer
Thanks! That's the trick!

I now use this second version. I will use this info to learn form it.

I had not thought of the possibility to use the filter-syntax to set the 
value. 

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/c3cbd1f0-5084-4ce5-9b5a-84d9c55024ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Using data dictionary for variable lookup

2019-02-05 Thread Chris Brouwer
Hello all,

I have the following situation, but can't acheive my goal. What am I doing 
wrong here ?

I hav a Datatiddler containing country codes (abbreviations) as indices and 
a sort code as values, like this:

CZ:01
SK:02
HU:03
RO:04
SRB:05

I have a tiddler with a Select widget, where I let the user choose a 
country code.
The resulting code is correctly placed in the "country" field. So far so 
good.

Here's the catch:
I also would like to place the sort code in a seperate field of the same 
tiddler. But accessing the DataTiddler seems to work only when I use a 
hardcoded countrycode, like {{landcodes##RO}}.

But what I would like is: {{landcodes##<>}}, or whatever way to get 
to the correct value. I have tried constructs with "<<", "$(", '"""$' but 
nothing seems to do the trick.

Any suggestions ?

Here is the contents of my test-tiddler:
-
\define update-sort()
<$vars lnd={{!!land}} >
<$action-setfield $tiddler=<> $field="sort" 
$value={{landcodes##<>}} />

\end

\define getLand()
<$select tiddler=<> field="land" actions=<> >
  <$list filter='[[landcodes]indexes[]sort[title]]' listItem=selectedList >
  >><$view field='title'>
  

\end

<>
-

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/3cbf56eb-d52d-4a18-9510-a4315d55416c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: List macro says: No result, where Advanced Search finds tiddlers

2019-01-25 Thread Chris Brouwer
Thanks very much, Mark!

I have tried something like this, but probably still made a mistake 
somewhere.

This is working as expected.

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/be1e8abb-9e5c-4e2c-aa74-886e1dc2dfe0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: List macro says: No result, where Advanced Search finds tiddlers

2019-01-25 Thread Chris Brouwer
Hello Mark,

I already tried that construct, with the same result.

I add the tiddler here, and a screenshot of the output.

Still, with my version of the code, this is the filter it shows: **
[tag[Overnachting]trip[Balkan 2019]sort[title]]** (Without the '**', of 
course ;-) )
So that looks like it does work (construct the correct filter, I mean). 
When I feed that to Advanced Search,, it gives me the expected reults. The 
<$list> does not.

Op vrijdag 25 januari 2019 16:18:03 UTC+1 schreef Mark S.:
>
> It would take a half hour to set up data to give an exact fix, but what 
> stands out immediately is that you are inserting wikitext into wiki text, 
> which doesn't work:
>
> Here
>
> <>
>
> Hier
>
> <$list filter=< prefix:"">> emptyMessage="Niets gevonden">
>
> <>
>
> I think what you want is to make changes like:
>
> <>
> ...
> <$list filter=< prefix:"">> emptyMessage="Niets gevonden">
>
> And invoke the macro with a macro call:
>
> <$macrocall $name=list-body tag="Overnachting" trip={{$:/vak/curTrip}} />
>
> If you share a page as well, it wold be easier to tell if the syntax was 
> right, but I think that's what you need.
>
> Good luck
> -- Mark
>
>
> On Friday, January 25, 2019 at 6:29:06 AM UTC-8, Chris Brouwer wrote:
>>
>> Hello Ton,
>>
>> allthough this is enlightening for me, the situation is a bit more 
>> complex.
>>
>> I am trying to adapt a little bit of Mario Pietsch's excellent work, just 
>> to include 1 extra filtering parameter.
>>
>> Here is (most of) the code I changed:
>>
>> \define createTripFilter(tag:"" trip:"" prefix:"")
>> [tag[$tag$]trip[$trip$]sort[title]]
>> \end
>>
>> \define list-body(tag:"" trip:"" prefix:"")
>> --
>> """$tag$"""
>> """$trip$"""
>> <>
>> --
>> 
>> Naam
>> Keuze
>> Prijs
>> Periode
>>
>> <$list filter=<> prefix:"">> emptyMessage="Niets gevonden">
>> <>
>> <>
>> <>
>> <>
>> 
>> 
>> \end
>>
>> <>
>>
>>
>> I am using Tiddlywiki 5.1.19.
>>
>> The tiddlers I am looking for contain the tag "Overnachting", and the 
>> name of the trip in the field "trip".
>>
>>
>>
>> Op vrijdag 25 januari 2019 15:13:05 UTC+1 schreef Ton Gerner:
>>>
>>> Hi Chris,
>>>
>>> May be this 
>>> <https://groups.google.com/d/msg/tiddlywiki/M5bA6_NKacM/SC-b60hTBQAJ> 
>>> helps.
>>>
>>> Cheers,
>>>
>>> Ton
>>>
>>>
>>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/ad584649-d621-449d-812f-e926ad3b230b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


$__vak_overnachting-list-template.tid
Description: Binary data


[tw5] Re: List macro says: No result, where Advanced Search finds tiddlers

2019-01-25 Thread Chris Brouwer
Hello Ton,

allthough this is enlightening for me, the situation is a bit more complex.

I am trying to adapt a little bit of Mario Pietsch's excellent work, just 
to include 1 extra filtering parameter.

Here is (most of) the code I changed:

\define createTripFilter(tag:"" trip:"" prefix:"")
[tag[$tag$]trip[$trip$]sort[title]]
\end

\define list-body(tag:"" trip:"" prefix:"")
--
"""$tag$"""
"""$trip$"""
<>
--

Naam
Keuze
Prijs
Periode

<$list filter=<> emptyMessage="Niets gevonden">
<>
<>
<>
<>


\end

<>


I am using Tiddlywiki 5.1.19.

The tiddlers I am looking for contain the tag "Overnachting", and the name 
of the trip in the field "trip".



Op vrijdag 25 januari 2019 15:13:05 UTC+1 schreef Ton Gerner:
>
> Hi Chris,
>
> May be this 
>  
> helps.
>
> Cheers,
>
> Ton
>
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/2064e691-c131-401e-9b77-e28c311d8bdf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] List macro says: No result, where Advanced Search finds tiddlers

2019-01-25 Thread Chris Brouwer
Hello all,

I am trying to produce a list of tiddlers, filtered based on 1 tag and the 
contents of 1 field, inside a macro.

For debugging purposes I output the separate parts, as well as the 
constructed filter.

Everything looks as I expect it. But the macro still comes up with an empty 
list.

So ofcourse I tried the exact same filter in Advanced Search (Copy/Paste 
from the debugging output), and this time I do get the results I want, not 
an empty list.

Why is TiddlyWIki list widget giving me a different result ?

I have tested with a combination of 2 tags, with and without spaces, but 
the results are consistent.

Any thoughts ?

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/3cff8950-e9eb-4a2c-9751-410b915e2089%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.