You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2020/11/23 14:28:55 UTC

[sling-org-apache-sling-app-cms] 03/05: Updating the column control to allow setting the row class

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git

commit a2eb1f7593dcf7546dc28754403d8432c3d40474
Author: Dan Klco <dk...@apache.org>
AuthorDate: Mon Nov 23 09:25:57 2020 -0500

    Updating the column control to allow setting the row class
---
 .../components/general/columncontrol/columncontrol.jsp         | 10 +++++-----
 .../reference/components/general/columncontrol/config.json     |  7 +++++++
 ui/src/main/resources/jcr_root/conf/global.json                |  1 +
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/reference/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp b/reference/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
index a673a3e..9595576 100644
--- a/reference/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
+++ b/reference/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */ --%>
- <%@include file="/libs/sling-cms/global.jsp"%>
+<%@include file="/libs/sling-cms/global.jsp"%>
+<sling:adaptTo adaptable="${resource}" adaptTo="org.apache.sling.cms.ComponentPolicyManager" var="componentPolicyMgr" />
+<c:set var="configRsrc" value="${componentPolicyMgr.componentPolicy.componentConfigs['reference/components/general/columncontrol']}" />
 <c:choose>
     <c:when test="${properties.container == true}">
-        <sling:adaptTo adaptable="${resource}" adaptTo="org.apache.sling.cms.ComponentPolicyManager" var="componentPolicyMgr" />
-        <c:set var="configRsrc" value="${componentPolicyMgr.componentPolicy.componentConfigs['reference/components/general/columncontrol']}" />
         <div class="${configRsrc.valueMap.containerclass}">
-            <div class="row">
+            <div class="${configRsrc.valueMap.rowClass}">
                 <c:forEach var="col" items="${fn:split(properties.layout,',')}" varStatus="status">
                     <div class="${sling:encode(col,'HTML_ATTR')}">
                         <sling:include path="col-${status.index}" resourceType="sling-cms/components/general/container" />
@@ -32,7 +32,7 @@
          </div>
      </c:when>
      <c:otherwise>
-         <div class="row">
+         <div class="${configRsrc.valueMap.rowClass}">
             <c:forEach var="col" items="${fn:split(properties.layout,',')}" varStatus="status">
                 <div class="${sling:encode(col,'HTML_ATTR')}">
                     <sling:include path="col-${status.index}" resourceType="sling-cms/components/general/container" />
diff --git a/reference/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json b/reference/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
index 0fc0f9c..7424d36 100644
--- a/reference/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
+++ b/reference/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
@@ -21,5 +21,12 @@
         "label": "Container Class",
         "name": "containerclass",
         "required": true
+    },
+    "rowclass": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "sling-cms/components/editor/fields/text",
+        "label": "Row Class",
+        "name": "rowClass",
+        "required": true
     }
 }
\ No newline at end of file
diff --git a/ui/src/main/resources/jcr_root/conf/global.json b/ui/src/main/resources/jcr_root/conf/global.json
index 1089ded..7ec5881 100644
--- a/ui/src/main/resources/jcr_root/conf/global.json
+++ b/ui/src/main/resources/jcr_root/conf/global.json
@@ -198,6 +198,7 @@
                             "50% 50%=col-6,col-6",
                             "33% 33% 33%=col-4,col-4,col-4"
                         ],
+                        "rowClass": "row",
                         "sling:resourceType": "sling-cms/components/caconfig/component"
                     },
                     "component_1644835788": {