Am Montag, 16. April 2007 15:49 schrieb Grégory Joseph:
> > I think freemarker doesn't in general make a distinction between
> > foo.baz and
> > foo['baz'].  Either should return the same value.  ie the property
> > or child
> > named 'baz'.  In our case either a wrapped NodeData or a wrapped
> > Content.
>
> Then how to deal with nodes which have a child called "bar" AND a
> property with the same name? 

I don't think admincentral handles this.  At least not the version I have 
installed on my developers machine.  The second entry is updated so there 
isn't a name clash.

>
> >> * since properties could be used more often than subnodes in
> >> templates, it might be interesting to revert the [] notation: foo.bar
> >> would mean "bar property of foo" while foo['bar'] would mean "bar
> >> child of foo", eventhough that doesn't seem very intuitive from my
> >> programmer's point of view.
> >
> > foo['bar'] should be the same as foo.bar.
>
> Same question as above.

I meant that in a freemarker template foo['bar'] is equal to foo.bar. The . or 
the [] notation are meant to mean the same thing.  At the model level they 
both call get() on your hash.

>
> >> *  how to expose other Content properties, such as handle and uuid?
> >> Chris suggests using [EMAIL PROTECTED] or [EMAIL PROTECTED] OTOH, I'm not
> >> convinced these should be used very often in templates,
> >
> > is 'should' here prescriptive or descriptive?
>
> Err, as to not get lost in english grammar (which as it shows I do
> not master), I meant: I'm under the impression that most templates
> will not need - or not very often - to output the handle or uuid of
> the nodes they're rendering.

I use the handle of content nodes regularly.


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------

Reply via email to