Thanks so much, Eric and Tony. As usal, this was extremely helpful. And 
<$wikify> actually solved the issue. 

In fact, I was assuming the transclusion chain had to do with it (hence the 
thread title), I am just not literate enough in TW to draw the right 
conclusions and find the remedies. But I keep on working at it.

Which brings me to another point: maybe I've overcomplicated things by 
storing a transclusion in a tiddler where a pointer to an array index in 
the JSON tiddler (i.e. a number) should have done the trick. But that's a 
different story.

So, thanks again, guys, much appreciated.

TW Tones schrieb am Mittwoch, 19. August 2020 um 01:47:32 UTC+2:

> Werner,
>
> I am confident Eric is spot on. It was the correct understanding of this 
> issue and the use of wikify that stopped me getting stuck regularly. I have 
> being trying to get some activity on this because it is a barrier to new 
> users. Perhaps this quick note will help as a rule until you fully 
> understand it.
>
>    - If you need a value to be "evaluated" from wikitext to use within 
>    subsequent Wikitext logic use the wikify widget at the last possible 
> moment.
>       - This guide suggests trying to use wikify in external macros is a 
>       path to disappointment
>    - Make sure you close the wikify appropriately (as with all other 
>    widgets) or unusual and broken result will occur
>    - Its only at the final render of the tiddler that all things are 
>    wikified automatically so a standalone `<<varormacro>>` appears to produce 
>    the result you want, but as Eric said the result inside the wikitext 
>    (before evaluation) without wikification it is not evaluated at that point.
>    - It is fine to use the same name when wikifying to stop code 
>    complexity
>
> \define macroname() blah blah
> <$wikify name=macroname text="<<macroname>>">
>    use <<macroname>> here where it is the wikified version, or pre-
> evaluated
> </$wikify>
>
> In closing
>
>    - If some of our community developers see this what would be better is 
>    something like the following;
>       - Allow any variable to be referenced in its "evaluated state" eg 
>       ((macroname)) would effectively wikify inline
>       - Automatically wikify/evaluate variables or macros when used in 
>       filters and other appropriate places.
>    
> Regards
> Tones
>
>
> On Wednesday, August 19, 2020 at 7:15:51 AM UTC+10, Eric Shulman wrote:
>>
>> On Tuesday, August 18, 2020 at 10:06:59 AM UTC-7, Werner wrote:
>>>
>>> I am referring to a tiddler called activeDossier whose contents refers 
>>> to a JSON data tiddler. Tiddler content 
>>> is {{$:/data/CI/companyRegister##1/name}}.
>>>
>>> <$set name="theCompany" value={{$:/data/CI/activeDossier}}>
>>> !<$vars tv-wikilinks=no><<theCompany>></$vars> <!-- gets displayed 
>>> properly -->
>>> <$list filter="[!is[system]search<theCompany>]" >
>>> <<currentTiddler>>
>>> </$list>
>>> </$set> 
>>>
>>
>> The problem is that you are doing a "double transclusion".  That is, the 
>> value of <<theCompany>> retrieved via transclusion isn't the actual name of 
>> the company as text, but rather a secondary transclusion from a JSON 
>> tiddler (i.e., {{$:/data/CI/companyRegister##1/name}}).  When you render 
>> <<theCompany>>, TiddlyWiki automatically parses that transclusion and 
>> displays the actual value.  However, when you use search<theCompany> in the 
>> filter, the value isn't parsed any further, and you are literally searching 
>> for the transclusion syntax, not the actual company name as text.
>>
>> To resolve this, use <$wikify> instead of <$set> to fetch theCompany 
>> value, like this:
>> <$wikify name="theCompany" text={{$:/data/CI/activeDossier}}>
>> !<$vars tv-wikilinks=no><<theCompany>></$vars> <!-- gets displayed 
>> properly -->
>> <$list filter="[!is[system]search<theCompany>]" >
>> <<currentTiddler>>
>> </$list>
>> </$wikify>
>> The $wikify gets the value from the activeDossier tiddler AND then also 
>> parses that value, so the result is the desired text value from the 
>> underlying $:/data/CI/companyRegister tiddler.
>>
>> When you use it in the search<theCompany> filter, it's already fully 
>> resolved to be the actual company name as text, so the search should work 
>> as you intend.
>>
>> -e
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2a3567a4-b52a-4e8e-81a8-4f0bddec5aben%40googlegroups.com.

Reply via email to