Nils Breunese wrote:
Nils Breunese wrote:
I know I can auto-generate paragraphs on pages using an
autoGeneratedParagraph content node, although this feature doesn't seem
to be documented in the documentation. I want to use an auto-generated
paragraph in an extrasArea, specifically in the extras2 sub-area. I
don't see how I could achieve that, if it is possible.
A colleague of mine just pointed me to
info.magnolia.module.templatingkit.templates.SingletonParagraphTemplateModel
where in the createExtrasArea method I find the following on line 95:
----
//for now: render all in the first column
----
So I guess auto-generating paragraphs in extras2 is not possible
(without somehow overriding this method)?
I have implemented custom versions of the AutoGeneratedExtrasArea and
SingletonParagraphTemplateModel classes (and added an ExtrasColumn
class) so now we are able to configure auto-generated paragraphs for
specific columns in the extrasArea.
For example we can now configure a template like this:
----
templateName
extrasArea
extrasColumns
extras2
autoGeneratedParagraphs
someParagraph
defaultValues
someKey1: someValue1
someKey2: someValue2
name: someParagraph
class: (custom).ExtrasColumn
class: (custom).AutoGeneratedExtrasArea
columns: 2
modelClass: (custom).SingletonParagraphTemplateModel
----
Along the way I have also changed createMainArea, so it is not necessary
to have an auto-generated paragraph in the main area when you want an
auto-generated paragraph in the extrasArea.
Would Magnolia be interested in adopting these changes?
Nils.
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------