What happened to the context.locals

In a template the scope for all data references is context.locals, i.e. any reference to a variable called 'my_name' actually means context.locals.my_name. Publishing objects for use by the template means storing them in ctx.locals.

expr="name.value()" ... Why isn't it just name?

Here's the important bit in the documentation from section 5.3.7, "http://www.object-craft.com.au/projects/albatross/albatross/tag-for.html".

If you look at ListIterator's methods it will probably make more sense now. It is ListIterator that makes the paging possible and the index() can be used for things like colouring alternate rows, i.e. name.index()%2 and 'red' or 'green'.

By the way, Dave has only just updated this bit of documentation based on feedback on the list so don't feel bad about missing the importance of ListIterator. It was documented but it was not as clear as it could have been.

why isn't it environ[name.value()].value()

So, why isn't the .value() needed on the end? Hopefully you now understand that:

So all "environ[name.value()]" is actually doing is getting the value of the item in environ that has a key name.value(). The <al-value> tag has no need to create anything like the ListIterator as all it does is print some text to the page.

Parent: PuzzledAboutBitsAndPieces

None: TemplateContext (last edited 2011-02-15 06:05:17 by localhost)