[opencms-dev] Nested containers

Alex Kandzior alex at opencms.org
Sun May 29 17:49:11 CEST 2022


Hi Laurent!
> And it works! It seems that we can only have one main div in the formatter.
> 
You are right, a formatter must create one closed HTML block element only. Otherwise it won’t work.

Of course, inside this block element you can have any kind of valid HTML structure.

Kind regards,
Alex.

-------------------
Alexander Kandzior

Alkacon Software - The OpenCms Experts                                                    
http://www.alkacon.com - http://www.opencms.org                                                          


> Am 28.05.2022 um 17:39 schrieb Laurent Druart via opencms-dev <opencms-dev at opencms.org>:
> 
> Dear all,
> 
> I fixed the problem by myself. It's a very strange behaviour.
> 
> My formatter was like:
> 
> <cms:formatter var="content" val="value"> 
>   <div> 
>     <div> 
>       <h2>${value.Title}</h2> 
>       <p>${value.Configuration}</p> 
>     </div> 
>   </div> 
>   <div class="row g-5"> 
>   <c:forEach begin="1" end="4" var="i" step="1"> 
>       <div class="col-lg-3"> 
>       <c:out value="${i}"/><br> 
>                 <cms:container name="col-container${i}" type="layout" 
>                width="500" maxElements="8" tagClass="my-container-border"> 
>                <h4> 
>                Please add content 
>                </h4> 
>                </cms:container> 
>     </div> 
>   </c:forEach> 
>   </div> 
> </cms:formatter> 
> 
> I deleted the first DIV so my formatter is now:
> 
> <cms:formatter var="content" val="value"> 
>   <div class="row g-5"> 
>   <c:forEach begin="1" end="4" var="i" step="1"> 
>       <div class="col-lg-3"> 
>       <c:out value="${i}"/><br> 
>                 <cms:container name="col-container${i}" type="layout" 
>                width="500" maxElements="8" tagClass="my-container-border"> 
>                <h4> 
>                Please add content 
>                </h4> 
>                </cms:container> 
>     </div> 
>   </c:forEach> 
>   </div> 
> </cms:formatter>
> 
> And it works! It seems that we can only have one main div in the formatter.
> 
> Kind regards,
> 
> Laurent
> 
> Le 27/05/22 à 12:34, Laurent Druart a écrit :
>> Hello Filip,
>> 
>> I already tested with and without type 'element', 'content',...
>> 
>> I don't have a checkbox 'use nested containers' in my formatter's config. I'm using OpenCMS 13.
>> 
>> Thanks for your help
>> 
>> Kind regards,
>> 
>> Laurent
>> 
>> Le 27-05-22 à 11:20, Filip Kratochvil a écrit :
>>> Maybe the problem is, that classic content types can by placed to the containers of type 'element'. But your example type is 'layout' (its suitable only for layout rows).
>>> 
>>> Additionaly, check if you marked checkbox 'use nested containers' in your formatter's config. 
>>> 
>>> Dne pá 27. kvě 2022 10:05 uživatel Laurent Druart via opencms-dev <opencms-dev at opencms.org <mailto:opencms-dev at opencms.org>> napsal:
>>> Hello Tobias,
>>> 
>>> I already tested with detailview and detailonly properties but it does'nt work.
>>> 
>>> Kind regards,
>>> 
>>> Laurent
>>> 
>>> Le 27/05/22 à 09:45, Tobias Karrer via opencms-dev a écrit :
>>>> Hi!
>>>> 
>>>> I'd guess your cms:container on the detail page is missing the attribute detailview="true" or detailonly="true" (as detailview="false" is the default as far as I remeber)
>>>> 
>>>> You as well could check the request if on a detail page to add the additional container, e.g. 
>>>> 
>>>> <cms:container name="centercontainer" type="center" width="650" detailview="true"/>
>>>> <c:if test="${cms.detailRequest}">
>>>>   <cms:container name="centercontainerDetail" type="center" width="650" detailonly="true"/>
>>>> </c:if>
>>>> BR, Tobias
>>>> 
>>>> Am 27.05.2022 um 07:55 schrieb Laurent Druart via opencms-dev:
>>>>> Hello, 
>>>>> 
>>>>> I'm trying to use nested containers... 
>>>>> 
>>>>> I created a content "row" and in the formatter on this content I'm creating nested containers with: 
>>>>> 
>>>>> <cms:formatter var="content" val="value"> 
>>>>>   <div> 
>>>>>     <div> 
>>>>>       <h2>${value.Title}</h2> 
>>>>>       <p>${value.Configuration}</p> 
>>>>>     </div> 
>>>>>   </div> 
>>>>>   <div class="row g-5"> 
>>>>>   <c:forEach begin="1" end="4" var="i" step="1"> 
>>>>>       <div class="col-lg-3"> 
>>>>>       <c:out value="${i}"/><br> 
>>>>>                 <cms:container name="col-container${i}" type="layout" 
>>>>>                width="500" maxElements="8" tagClass="my-container-border"> 
>>>>>                <h4> 
>>>>>                Please add content 
>>>>>                </h4> 
>>>>>                </cms:container> 
>>>>>     </div> 
>>>>>   </c:forEach> 
>>>>>   </div> 
>>>>> </cms:formatter> 
>>>>> 
>>>>> I can drag and drop this content on a page but I can't drag and drop other contents in this component. Nested containers are not "visible". 
>>>>> 
>>>>> First I tried without element views and now I've added element views: "page" for my main container and "layout" for my nested containers but this will not work. 
>>>>> 
>>>>> Where is my error? 
>>>>> 
>>>>> Thank you, 
>>>>> 
>>>>> Laurent 
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________ 
>>>>> This mail is sent to you from the opencms-dev mailing list 
>>>>> To change your list options, or to unsubscribe from the list, please visit 
>>>>> https://lists.opencms.org/mailman/listinfo/opencms-dev <https://lists.opencms.org/mailman/listinfo/opencms-dev> 
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> This mail is sent to you from the opencms-dev mailing list
>>>> To change your list options, or to unsubscribe from the list, please visit
>>>> https://lists.opencms.org/mailman/listinfo/opencms-dev <https://lists.opencms.org/mailman/listinfo/opencms-dev>
>>>> 
>>>> 
>>>> 
>>> 
>>> _______________________________________________
>>> This mail is sent to you from the opencms-dev mailing list
>>> To change your list options, or to unsubscribe from the list, please visit
>>> https://lists.opencms.org/mailman/listinfo/opencms-dev <https://lists.opencms.org/mailman/listinfo/opencms-dev>
>>> 
>>> 
>>> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> https://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20220529/2d689b37/attachment.htm>


More information about the opencms-dev mailing list