HI @rajumuddana ,
By default, the Column Control component in AEM allows you to set a fixed number of columns using the columnAmount property. However, if you want to have different numbers of columns for the Column Control component on load for different templates, you can achieve this by customizing the component's logic.
Here's a general approach to implement this customization:
Create a new component that extends the Column Control component. This new component will serve as a wrapper for the original Column Control component.
In the new component, create a new dialog field (e.g., templateColumns) to specify the number of columns for each template. This field will allow authors to set different numbers of columns for different templates.
In the new component's HTL file, retrieve the current template path and use it to determine the number of columns to display. You can use the templateColumns field value from the dialog to map the template path to the corresponding number of columns.
Pass the calculated number of columns to the original Column Control component as a property.
Here's an example of how the HTL file of the new component could look like:
<sly data-sly-use.templatePath="com.adobe.cq.wcm.core.components.models.TemplatePath">
<!-- Get the current template path -->
<sly data-sly-test="${templatePath.templatePath}">
<!-- Determine the number of columns based on the template path -->
<sly data-sly-test="${properties.templateColumns}">
<sly data-sly-test="${properties.templateColumns[templatePath.templatePath]}">
<!-- Pass the number of columns to the original Column Control component -->
<sly data-sly-resource="${'columncontrol' @ columnAmount=properties.templateColumns[templatePath.templatePath]}"></sly>
</sly>
</sly>
</sly>
</sly>
In this example, the templatePath object is used to retrieve the current template path. The templateColumns field from the dialog is used to map the template path to the corresponding number of columns. The calculated number of columns is then passed to the original Column Control component using the columnAmount property.
By customizing the Column Control component in this way, you can set different numbers of columns for the component on load for different templates in AEM 6.5.