Containers inside a container

61 views
Skip to first unread message

Laurent Druart

unread,
Dec 29, 2022, 8:50:27 AM12/29/22
to dotCMS User Group
Hello,

I'm new with dotCMS and I've a  question:

is it possible to have a container wich contains other containers?
Example: A row component which contains columns where contents will be displayed?

Thanks for your help

Laurent

Jameson Mauro

unread,
Dec 29, 2022, 10:11:00 AM12/29/22
to dotCMS User Group
Indeed it is possible. The key distinction is between a Container and a Template. A template uses rows and columns in exactly the way you describe: Rows hold columns, and columns include one or more containers. Here's a diagram showing the major relationships.

In the Template Designer, columns are the "boxes" you can add, move, stretch, and fill with the containers that will be in charge of how different sorts of content are displayed:

template.png

Laurent Druart

unread,
Dec 29, 2022, 11:14:12 AM12/29/22
to dotCMS User Group
Thanks for your answer. The row example was not a good idea. I would like to know if we can define a content type which contains containers where other contents will be dropped.

Jameson Mauro

unread,
Dec 29, 2022, 1:56:53 PM12/29/22
to dotCMS User Group
I think it depends on the specific use case and type of content. For example: a Content Type can be defined such that it contains rows and columns in which you arrange a series of fields in rows or columns that can allow a user to drop in file content. An example of how that might be arranged is below: 

Screenshot 2022-12-29 at 1.41.42 PM.pngScreenshot 2022-12-29 at 1.42.10 PM.png

If the question is just "can a Content Type contain other Content Types," then you might be able to achieve this with the Block Editor field, which can be configured to render arbitrary user-defined content, by selecting "Contentlets" on the interface and then navigating to the content in question.

Screenshot 2022-12-29 at 1.51.35 PM.png

Does something like that fit the bill? If not, what would be an example of the kind of end user experience you're envisioning?

Laurent Druart

unread,
Dec 30, 2022, 6:13:48 AM12/30/22
to dotCMS User Group
My understanding of dotcms is a template contains container(s) where different content can be dropped. A content is an instance of a content type.

But does a content type can contain containers?

I want to provide to end user a toolbox  where he can build a page as he wants. Example: Dropping a row in the main container, the row has a parameter like '2-4-4-2' ou '3-3-3' or.. which generates containers columns. In these columns different contents can be dropped and some of contents can contain containers,... So containers can contain containers "recursively". This functionnality is available in other java CMS like OpenCMS or Magnolia. Does dotCMS permit that functionnality? The row is just an example.

Thank you

Laurent Druart

unread,
Jan 10, 2023, 2:12:08 AM1/10/23
to dotCMS User Group
Hello,

I suppose this functionnality is not available in dotCMS?

Mark Pitely

unread,
Jan 10, 2023, 9:27:17 AM1/10/23
to dot...@googlegroups.com
There's absolutely no problem with building what you are discussing, and much more.
The base template you can see on the live test site allows you to create multiple columns and rows, etc. on the fly, approximating something like Divi. 
It can also function headless, if necessary, so you could build just about anything using the tooling and some javascript. 
The issue was that you used an internal term (Container) which has a specific meaning in dotCMS and did not match what you were originally asking, so you threw the community for a loop. 

Mark Pitely
Albright College

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/a858025f-4084-4316-a2c8-2b55f8516227n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages