Use <!–@ParagraphContainer–> to make paragraphs render different content depending on placement #Dynamicweb

With the Layout system you define various content areas in the Layout file like this:

Part of example layout template:

  

<div id="left" class="dwcontent" title="Left content" settings="paragraph:left.html">We do not want module content here, for some strange reason</div>

<div id="main" class="dwcontent" title="Main content" settings="paragraph:main.html"></div>

<div id="right" class="dwcontent" title="Right content" settings="paragraph:right.html"></div>

 

This will create a three column page. Imagine that in the left col we do not want the user to be able to add paragraphs which renders module output. We can do that by adding tests for the ParagraphContainer value in the paragraph like this:

Part of example paragraph template

  

<!--@If(ParagraphContainer!="left")-->

output your content here

<!--@EndIf-->

The above test will ensure that no content will be returned if you use the paragraph in the left coloum. Combined with a selected default paragraphtemplate (settings="paragraph:left.html") as you can see in the layout file above, will help ensuring that editors will

a) Get a head start with choise of template (a default will be selected for them, related to which content area they add content to

b) No paragraph templates outputing module content can be added to the left coloum

 

A wish for improvement to the Dynamicweb template system

This leads to my wish for an improvement in the Dynamicweb template system: Please add two tags from the paragraphlevel template to the module template:

a) ParagraphContainer – so that the module template will be aware of in which layout placeholder it is rendered

b) ParagraphName – Which paragraph template is used? Allows the module content to be controled by the paragraph used for it. This would actually also be relevant to add to the paragraph template too.

US

Leave a Reply