Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

textimage component- placeholder

Avatar

Level 5

Hi,

I am using textimage componet by adding image position option: left , right, top, bottom.

reference :https://docs.adobe.com/docs/v5_1/html-resources/cq5_guide_developer/ch07s04.html,

: when I am using  <div <%= style %> class="image"> in our jsp for image position , placholder of parsys of  next component is coming over the image , if the position of image is right.
Please let me know how can i handle placeholder in edit mode.Please see the screen shot.

2 Replies

Avatar

Community Advisor

varuns46785756 wrote...

Hi,

I am using textimage componet by adding image position option: left , right, top, bottom.

reference :https://docs.adobe.com/docs/v5_1/html-resources/cq5_guide_developer/ch07s04.html,

: when I am using  <div <%= style %> class="image"> in our jsp for image position , placholder of parsys of  next component is coming over the image , if the position of image is right.
Please let me know how can i handle placeholder in edit mode.Please see the screen shot.

 

Hi Varun,

Are you using OOTB component or geometrixx textimage component ?

can you share the component that your using ?

Avatar

Level 5

Hi Korthivada,

I am using OOTB component.just modified tab1 and tab2 but problem in my component is , when I am using style the position of placeholder going to disturb.

component code :

%@ page import="com.day.cq.commons.Doctype,
    com.day.cq.wcm.api.WCMMode,
    com.day.cq.wcm.api.components.DropTarget,
    com.day.cq.wcm.foundation.Image, com.day.cq.wcm.foundation.Placeholder" %><%
%><%@include file="/libs/foundation/global.jsp"%><%
    boolean isAuthoringUIModeTouch = Placeholder.isAuthoringUIModeTouch(slingRequest);

    Image image = new Image(resource, "image");

    // don't draw the placeholder in case UI mode touch it will be handled afterwards
    if (isAuthoringUIModeTouch) {
        image.setNoPlaceholder(true);
    }

    //drop target css class = dd prefix + name of the drop target in the edit config
    String ddClassName = DropTarget.CSS_CLASS_PREFIX + "image";

    if (image.hasContent() || WCMMode.fromRequest(request) == WCMMode.EDIT) {
        image.loadStyleData(currentStyle);
        // add design information if not default (i.e. for reference paras)
        if (!currentDesign.equals(resourceDesign)) {
            image.setSuffix(currentDesign.getId());
        }
        image.addCssClass(ddClassName);
        image.setSelector(".img");
        image.setDoctype(Doctype.fromRequest(request));

        String divId = "cq-textimage-jsp-" + resource.getPath();
        String imageHeight = image.get(image.getItemName(Image.PN_HEIGHT));
        // div around image for additional formatting


       String style="";
    if (properties.get("imagePosition", "left").equals("right")) {
         style = "style=\"float:right\"";
    }
        if (properties.get("imagePosition", "left").equals("left")) {
         style = "style=\"float:left\"";
    }
        %><div <%=style%> class="image" ><%
        %><% image.draw(out); %><br><%
    
    String placeholder2 = (isAuthoringUIModeTouch && !image.hasContent())
               ? Placeholder.getDefaultPlaceholder(slingRequest, component, "", ddClassName)
               : "";
    
        %><cq:text property="image/jcr:description" placeholder="<%= placeholder2 %>" tagName="small" escapeXml="true"/><%
        %></div>
        <%@include file="/libs/foundation/components/image/tracking-js.jsp"%>
        <%
    }

       String placeholder = (isAuthoringUIModeTouch && !image.hasContent())
               ? Placeholder.getDefaultPlaceholder(slingRequest, component, "", ddClassName)
               : "";
    %><cq:text property="text" tagClass="<%= "text " + ddClassName %>" escapeXml="true" placeholder=""/>

 

 

Regards,

Varun