Thank you very much Mark. I couldn't get your solution to work, but I did 
it differently, with a macro:

\define concatenate_filter(fd fi) 
<$visjstimeline filter="[$fd$$fi$]" startDateField="date-debut" 
endDateField="date-fin" format="YYYY-MM-DD" groupField="institution" 
boxing="auto" navpad />
\end

<$macrocall $name="concatenate_filter" fd={{!!filtre_domaine}} 
fi={{!!filtre_institution}} />
Le vendredi 16 avril 2021 à 20:18:59 UTC+2, Mark S. a écrit :

> Try:
>
> <$visjstimeline 
> filter="[<currentTiddler>get[filtre_domaine]compare:string:eq{!!filtre_institution}]"
>  
> startDateField="date-debut" endDateField="date-fin" format="YYYY-MM-DD" 
> groupField="institution" boxing="auto" navpad />
>
> This requires a recent edition of TW since it uses the compare operator.
>
> Double braces (e.g. {{ and }} ) don't work inside of filters. They get 
> reduced to single braces (as above). Text substitution only works inside of 
> macros, so here instead I use the "get" operator to fetch the contents of 
> the filtre-_domaine field and then compare it with the contents of 
> filtre_institution. It's good practice to put your filter inside double 
> quotes.
>
> This is a case where seeing a website would help -- setting up my own 
> visjstimeline test site might take hours.
>
> Good luck!
>
> On Friday, April 16, 2021 at 7:28:49 AM UTC-7 jln wrote:
>
>> Hi,
>>
>> I've a field named "filtre_domaine" with value tag[AÀP] and a second one 
>> named "filtre_institution" with value field:institution[CLARA]
>>
>> I would like to "inject" these values into a visjstimeline widget
>>
>> The following doesn't work :
>>
>> <$visjstimeline filter=[{{!!filtre_domaine}}{{!!filtre_institution}}] 
>> startDateField="date-debut" endDateField="date-fin" format="YYYY-MM-DD" 
>> groupField="institution" boxing="auto" navpad />
>>
>> so I guess I've to create a macro to concatenate the fields values:
>>
>> \define concatenate_filter() 
>> [{{!!filtre_domaine}}{{!!filtre_institution}}]
>>
>> The "result" of the macro is fine: when I call <<concatenate_filter>> I 
>> get 
>>
>> tag[AÀP]field:institution[CLARA]]
>> and if I copy/paste this litteral result into the widget, the Gantt chart 
>> is ok.
>>
>> But it doesn't work when I try to call the macro inside the widget:
>>
>> <$visjstimeline filter=<<concatenate_filter>> startDateField="date-debut" 
>> endDateField="date-fin" format="YYYY-MM-DD" groupField="institution" 
>> boxing="auto" navpad />. I get "Filter error: Missing [ in filter 
>> expression" but I dont' undertand why…
>>
>> Thanks!
>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7fbb2524-6ad7-4e16-a77d-81d839649c54n%40googlegroups.com.

Reply via email to