1 Reply Latest reply on Jan 23, 2013 7:38 AM by kasq

    How to change CQ component(text) width?

    apark2900 Level 1



      I want to create a page like this using a CQ text component.


      ------what I want ------------------------------------------------------------------------------

      Summary:    this is a summary content

      ------------------------------------------------------------------------------------------ --------


      But when I put include the text component, it automatically move to the next line as below image.




      Do you know how to change the width of text component,  or put it next to a text without moving to next line?

      This is my actual code for this page.


      Summary:  <cq:include path="text" resourceType="advance/components/text"/>

        • 1. Re: How to change CQ component(text) width?
          kasq Level 3

          Hi again Apark,


          Could you for example move "Summary" to the jsp of the text component and try code like:


          <% String summary=properties.get("summary",String.class); %>


          Summary: <%=summary%>


          or more advanced code for text component can be like this:


          <%@ page import="com.day.cq.wcm.api.WCMMode"%>

          <% String summary=properties.get("summary",String.class); %>


          <% if  (WCMMode.fromRequest(request) == WCMMode.EDIT && summary == null)  {%>


          <%} else { %>

              Summary: <%=summary%>



          In this case "Summary" will be visible only in case when you define a summary property in the dialog for your component.