Now that we are using the new objects I think that some of the
object names are too long or confusing:
For those of you who wonder what Philipp is talking about, since we
haven't really clearly communicated about this yet, have a look at
http://confluence.magnolia-cms.com/display/DEV/Roadmap+4.0#Roadmap4.0-Newtemplatingfeatures
- parameters: ${templateDef.parameters.name}
- parent definition: ${model.parent.renderable.name}
I propose to rename templateDef and paragraphDef to config and the
parameter map to params. I would also rename the "renderable"
property of the model to "config"
The example from above
- parameters: ${config.params.name}
- parent: ${model.parent.config.name}
Please provide your opinion.
Couple of remarks:
# With this naming, how do you get the "templateDef" when rendering
a paragraph ?
Currently we provide only the current definition (not both). Any
definition is available through the model's parent model:
model.parent.definition is the templateDef if the paragraph is a
direct subparagraph.
# Isn't "config" too vague ? i.e isn't that confusing with, perhaps,
a module's configuration bean, magnolia's configuration in
general, ... ?
Also, I think there is a differenciation to be made between
"definition" and "configuration", where the latter implies that
things in there can be customized, while the way I see it, it's more
a way of reusing templates (ftl) than providing configurable behavior.
So we could call it "definition" instead.
# I always we'd have "params" as an implicit map: ${config.foobar}
would return either config.getFoobar() if such a method existed,
else it would do config.getParameters().get("foobar"). This actually
looks like the same issue we have with ctx right now
(MAGNOLIA-2509), so this could maybe be solved the exact same way -
if "config" is a Renderable, it should pretty straightforward, once
2509 is fixed.
Yes, lets do that.
Other than that, I agree that these names are too long. But as
always, even though size supposedly does not matter, I favor clarity
over concision.
The templates become either very soon unreadable or you have big
assign block in the beginning.
So I propose to:
* use "definition" and model.parent.definition (consequently the
Renderable has to be renamed to RenderableDefinition)
* we map parameters to the definition object:
definition.parameters.name = definition.name (done by the freemarker
model)
This would satisfy my needs. Still we have to be aware of the fact
that the direct mapping is not available in jsp so.
Philipp
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------