Hi,
I go through several loops in a menu.html, recursive calls to the same template to iterate through a filetree (yes, it works now). But then I need to keep track of the .Page I am into, and the $ does not do what I thought it should do. The value of $.Page changes.
And then, .Store does the same.
You’ve defined a new template called “menu-filetree”.
The $ points to the context passed into “menu-filetree”.
If you want to access something from the template that first calls “menu-filetree”, you’ll have to pass it in context, both initially and with each recursive call.
If you want to access something from the template that first calls “menu-filetree”, you’ll have to pass it in context, both initially and with each recursive call.
Because scratch pads are created and accessed via the Scratch and Store methods on a Page object. To get to the Page object you need to pass the Page object.
I’m not sure how to make this any clearer. Perhaps someone else can help.
I got your point now.
One question though, where can I find information on that range $var := something syntax ? I can’t understand it anymore. say that defines the context within the loop, then what is being iterated through exactly ?
Ok, I could rewrite the original template (in term of functionality), understanding it this time. I suppose I should thank your RTFM stance, which at least for a programming language makes some sense. The user can make it right by trying, unlike with general OS problems.
Still, sorry the doc is very scant, an exemple with “is rendered to:”. That does not suffice, more words in plain English, eventually with common cases it could help with, would be much appreciated. Even said tip was in the forum already… to find it, one must often know what to look for first.
Here for instance I could not understand before trying out, that the context bound by a range does not mask variables defined earlier. Despite my own code using this elsewhere.
Anyway.