https://github.com/NiclasCedermalm/modules4dxa-java
- DXA Container Framework - a framework for doing container components in DXA
- Flex Layout DXA Module - contains a number of container implementations based on vanilla DXA templates
- Region are a course-grained area on a page, such as main area, side area, header, footer etc. They are managed by the page template/view.
- Containers are more fine-grained areas on a page which can be managed by editors such as adding new layouts on the page, add components to the layouts and move components between layouts.
The Solution
So after some tries I come up with the solution to have container and attached items beside each other on the page where the order on the page is important. Basically flatten the container structure into a plain list on the page. This is not a new invention, I’ve been playing around with this idea in customer projects in my previous life as consultant and as will in older customer demos. So this concept was reused and modernised into a DXA version. See below example how a page can be built up with containers and container items:
- Carousel with 2 teaser items
- 3-Column layout with 3 teaser items
- 2-Column layout with 2 teaser items
In CME the page looks as following:
Getting Started
To setup the DXA framework and the FlexLayout DXA module you need to do the following:
- Install the CME extension as described here: https://github.com/NiclasCedermalm/modules4dxa-java/tree/master/dxa-container-framework
- Clone the code repository: git clone https://github.com/NiclasCedermalm/modules4dxa-java
- Run the CMS import scripts as described here: https://github.com/NiclasCedermalm/modules4dxa-java/blob/master/dxa-module-flex-layout/cms/README.md
- Compile the Java code and install it in your local maven repo: mvn install –Pflexlayout (run in the root of the cloned repo)
- Add the module to your DXA webapp as described here: https://github.com/NiclasCedermalm/modules4dxa-java/tree/master/dxa-module-flex-layout
- Republish the Settings page and do /admin/refresh to trigger reload of all DXA config
- Now it should be possible to create new pages with various flexible layouts :-)
Let me know if you find any issues etc with the modules. Let's make some flexible DXA pages ;-)