Expand my Community achievements bar.

SOLVED

How to create a column control component in SPA React

Avatar

Level 2

Hi,

 

We have a requirement where we need to create a column control component where the number of column selection is driven by Author and based on the number of column selected the column control render the defined number of parsys.

This works fine by adding a logic in HTL for non-SPA pages but how the same behavior can be achieved in SPA.

I followed the below link but in that as well it is creating a single parsys at a time but we want to multiple parsys to be render (based on number of col selected in dialog).

Extending responsiveGrid using React in AEM SPA Architecture | AEM 6.5.5 – AEM Queries & Solutions (...

 

Something like this in SPA (not via a Layout mode)

 

image-20230202-122937.png

Please suggest.

Shikha

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @sharms13,

You should not built a separate component for this. The proper way will be to utilize responsive grid. This will allow authors to divide page into multiple columns e.g. using Layout Container component like this:

layout-container.png

or simply use Layout option to resizes components to put them under multiple columns:

resized-components.png

In general you can have a look into wknd SPA project as a reference.

Some useful links:

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @sharms13,

You should not built a separate component for this. The proper way will be to utilize responsive grid. This will allow authors to divide page into multiple columns e.g. using Layout Container component like this:

layout-container.png

or simply use Layout option to resizes components to put them under multiple columns:

resized-components.png

In general you can have a look into wknd SPA project as a reference.

Some useful links:

Avatar

Level 2

Hello @lukasz-m ,

 

Thank you for the valuable information you provided. I was wondering if it's possible to create a three-column layout component akin to what @sharms13 inquired about? We hope to utilize a solution that doesn't display AEM-related styles in the HTML markup, as it aligns more closely with our requirements. Would you have any recommendations or guidance on this?

 

Thank you!