Using a groovy builder (DSL) we could make the paragraph definition very concise
- include the dialog definition in the paragraph definition
- add a closure for rendering the content
example: text and image paragraph |
What we get:
- no configuration (update, ...)
- a single concise definition (all in one place)
- agile
Note: this will not replace any other ways of defining paragraphs or dialogs its just a groovy alternative. But since we allow pragmatic registration of dialogs, paragraph, ... in Magnolia 5.0 such an implementation should be rather trivial.
4 comments:
Interesting idea. I would also consider JSON. What do you mean by "pragmatic registration of dialogs, paragraph, ..."?
Philipp,
I like it! Very nice. I'd love to do this for Twigs.
What do you think about a common way of importing groovy packages/classes into the scripts workspace? Sort of like the templating kit does with freemarker scripts for inline templating.
Thanks,
Matt
Hi Philip
Your blog post has been discussed @ the latest hackergarten. I personally think your idea is great and feasible, but why "only" on paragraphs? I don't know Magnolia enough (yet), but I can imagine that a whole website (pages, paragraphs, dialogs, commands) beeing defined in a DSL. And Groovy is a great language to do so.
Oh and btw: Vaadin is a perfect builder candidate too....
Yes the example shows a paragraph combined with its dialog definition. Doing the same for pages would not differ at all. I just picket the most obvious and simples example.
"pragmatic registration" indeed interesting ;-) please read programatic registration
Post a Comment