see http://tmiyar.blogspot.com/2010/02/auto-generate-paragraphs.html

On Feb 25, 2010, at 8:52 AM, Teresa Miyar wrote:

Hi,

The auto generation Jan and I are talking about is that of the singleton paragraphs, that means you create the node with the corresponding template name and default parameters and the green bar you will se is the edition one. So you can create a new method 'createComments' that will get the main area, check if is there already and create it otherwise. Most important would be this line singletonNode.getMetaData().setTemplate("stkComments").

You could create your own model that extends STKTemplateModel so only templates with that model will render the comments paragraph, or maybe use the SingletonParagraphTemplateModel
On Feb 24, 2010, at 1:25 PM, Nils Breunese wrote:


Jan Haderka wrote:

Commenting is just a paragraph like any other paragraph. It is
defined in /templating-kit/templates/content/mainArea.ftl to ensure
that it is always added at the end of the list of paragraphs. The
paragraph data itself are stored in the page directly, rather then in
any areas. So for your pages where you want to enable it by default,
just autocreate this paragraph while creating the page. I might be
missing something you are strugling with, if so, could you please
clarify what the problem is?

As I recall the problem is that we can auto-generate the paragraph, but
the template for the paragraph
(/templating-kit/templates/content/mainArea.ftl) checks for a subnode
and as long as that doesn't exist the only thing that is shown is a
green bar with an 'Enable Commenting' button. So, apart from adding the
paragraph we also need to click that button to enable commenting. Or
somehow perform the action that clicking that button performs?

Nils.

De informatie vervat in deze e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde. De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mail, noch voor tijdige ontvangst daarvan.

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Best regards,

Teresa Miyar
Magnolia International Ltd.

Magnolia®  - Simple Open Source Content Management








----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Best regards,

Teresa Miyar
Magnolia International Ltd.

Magnolia®  - Simple Open Source Content Management







----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to