[tw5] Re: Lost in transclusion
and the wikify widget is finally, for the first time, clear to me. Thanks! On Tuesday, August 18, 2020 at 7:47:32 PM UTC-4 TW Tones wrote: > 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 `<>` 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="<>"> >use <> here where it is the wikified version, or pre- > evaluated > > > 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><> >>> <$list filter="[!is[system]search]" > >>> <> >>> >>> >>> >> >> The problem is that you are doing a "double transclusion". That is, the >> value of <> 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 >> <>, TiddlyWiki automatically parses that transclusion and >> displays the actual value. However, when you use search 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><> >> <$list filter="[!is[system]search]" > >> <> >> >> >> 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 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/4ed0fa0f-ff59-4eef-9529-56be0292f6c1n%40googlegroups.com.
[tw5] Re: Lost in transclusion
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 `<>` 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="<>"> >use <> here where it is the wikified version, or pre- > evaluated > > > 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><> >>> <$list filter="[!is[system]search]" > >>> <> >>> >>> >>> >> >> The problem is that you are doing a "double transclusion". That is, the >> value of <> 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 >> <>, TiddlyWiki automatically parses that transclusion and >> displays the actual value. However, when you use search 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><> >> <$list filter="[!is[system]search]" > >> <> >> >> >> 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 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.
[tw5] Re: Lost in transclusion
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 `<>` 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="<>"> use <> here where it is the wikified version, or pre-evaluated 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><> >> <$list filter="[!is[system]search]" > >> <> >> >> >> > > The problem is that you are doing a "double transclusion". That is, the > value of <> 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 > <>, TiddlyWiki automatically parses that transclusion and > displays the actual value. However, when you use search 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><> > <$list filter="[!is[system]search]" > > <> > > > 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 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/c2b45772-6cda-45b8-862a-bfefd5ba83b9o%40googlegroups.com.
[tw5] Re: Lost in transclusion
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><> > <$list filter="[!is[system]search]" > > <> > > > The problem is that you are doing a "double transclusion". That is, the value of <> 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 <>, TiddlyWiki automatically parses that transclusion and displays the actual value. However, when you use search 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><> <$list filter="[!is[system]search]" > <> 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 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/6fb2e598-4265-4984-b7f4-8757a255214co%40googlegroups.com.
[tw5] Re: Lost in transclusion
Hi Mark, yes, as written to Mat, title and text will do. Mark S. schrieb am Dienstag, 18. August 2020 um 19:43:45 UTC+2: > It looks like you want to search the text, title, or tag field for the > name of a company?? Is that what you want? If you want to search in some > non-default field, then you need to specify that field in your search. > > > On Tuesday, August 18, 2020 at 10:06:59 AM UTC-7, Werner wrote: >> >> Once again, I am feeling like a complete dumbass when dealing with >> transclusion and substitution. Still having a hard time with it. OK, here's >> the code: >> >> >> I am refering a tiddler called activeDossier whose contents refers to a >> JSON data tiddler. Tiddler content >> is {{$:/data/CI/companyRegister##1/name}}. What I basically want to do is >> auto-generating company dossiers, coming from various sources in my >> database. I have a list of companies as JSON from which I can select. This >> works up to the point below >> >> <$set name="theCompany" value={{$:/data/CI/activeDossier}}> >> >> !<$vars tv-wikilinks=no><> >> >> <$list filter="[!is[system]search]" > >> <> >> >> >> >> >> My problem is: the variable "theCompany" seems to be properly assigned, >> at least it gets displayed properly, so what am I doing wrong when I want >> to assign it to the list filter. I suspect, something along the >> transclusion chain is going wrong here, but I need someone to point me at >> it and how to find a remedy. >> >> Thanks to all helpful souls. >> > -- 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/6f0a4d7b-0cb6-4118-a684-018a426c2324n%40googlegroups.com.
[tw5] Re: Lost in transclusion
Hi Mat, yes, I want to search globally. A pretty basic search on all text and title fields. Mat schrieb am Dienstag, 18. August 2020 um 19:30:08 UTC+2: > It might be as simple as needing to use triple quoting, in case your > theCompanies have quote characters in them. > > But note that the filter [!is[system]search] refers to all > tiddlers globally, not e.g the current tiddler if that is what you hope > for. IF you want to test if theCompany !is[system] you must do e.g > [!is[system]... etc. > > <:-) > -- 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/9dc49013-3b0c-4474-9430-1a49a00268fbn%40googlegroups.com.
[tw5] Re: Lost in transclusion
It looks like you want to search the text, title, or tag field for the name of a company?? Is that what you want? If you want to search in some non-default field, then you need to specify that field in your search. On Tuesday, August 18, 2020 at 10:06:59 AM UTC-7, Werner wrote: > > Once again, I am feeling like a complete dumbass when dealing with > transclusion and substitution. Still having a hard time with it. OK, here's > the code: > > > I am refering a tiddler called activeDossier whose contents refers to a > JSON data tiddler. Tiddler content > is {{$:/data/CI/companyRegister##1/name}}. What I basically want to do is > auto-generating company dossiers, coming from various sources in my > database. I have a list of companies as JSON from which I can select. This > works up to the point below > > <$set name="theCompany" value={{$:/data/CI/activeDossier}}> > > !<$vars tv-wikilinks=no><> > > <$list filter="[!is[system]search]" > > <> > > > > > My problem is: the variable "theCompany" seems to be properly assigned, at > least it gets displayed properly, so what am I doing wrong when I want to > assign it to the list filter. I suspect, something along the transclusion > chain is going wrong here, but I need someone to point me at it and how to > find a remedy. > > Thanks to all helpful souls. > -- 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/70c4438d-c83f-4287-ac64-884e9e1aa10do%40googlegroups.com.
[tw5] Re: Lost in transclusion
It might be as simple as needing to use triple quoting, in case your theCompanies have quote characters in them. But note that the filter [!is[system]search] refers to all tiddlers globally, not e.g the current tiddler if that is what you hope for. IF you want to test if theCompany !is[system] you must do e.g [!is[system]... etc. <:-) -- 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/bc3ccec3-8667-4278-8e68-94240526938fo%40googlegroups.com.