michal frackowiak wrote on 05 Feb 2010 09:30
So far the design does not address the problem of nested contexts . The simplest case is a ListPages module in _template page.
Name of the current page: %%page:name%%
[[module ListPages]]
Name of the iterated page: %%page:name%%
Name of the current page: ?????????????
[[/module]]
First %%page:name%% obviously refers to the current page. %%page:name%% inside ListPages should be resolved in context of the iterated page. But what if you want to refer to the current page within ListPages? I would suggest something like %%:page:name%%.
There are not necessarily many use cases for this, but the issue is critical when we design proper scope-aware symbol resolver. It should have the possibility to access outer scopes too.
Yes, you raise a good point. I'd probably suggest named scopes to any depth, so:
page:name - closest page name
page::name - next one out
page:::name - two levels out
Especially if we start to have modules within modules.
But it gets very complex. Simpler would be to have different names and/or aliases so e.g. 'current:' is the same as 'page:' but always refers to the current page. Or 'this:' for iterated items. It is probably very rare to want to refer to the current page inside an iterator anyhow.
Portfolio