내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

can edit width of image when it in text component?

Avatar

Level 1

does aem has any native function for the user to edit width of image when it in text component manually

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee Advisor

Normally you should not deal with these things directly, because the system provides you with an overall style every text and image should adhere to. Manual "tweaks" is likely to cause problems because of broken layouts.

원본 게시물의 솔루션 보기

3 답변 개

Avatar

Community Advisor

Hi @user07108 ,

 

Width of the image inside the text component?   click on the source edit button and you can paste your html there and hence you can edit your height and width attributes. 

Screenshot 2022-08-25 at 3.04.56 PM.png


There's one problem here though, the image path might not get shortened on dispatcher/production.

I would suggest you to use the core component image which comes with renditions and you can make use of layout system.
Thank you.

-Sravan

Avatar

정확한 답변 작성자:
Employee Advisor

Normally you should not deal with these things directly, because the system provides you with an overall style every text and image should adhere to. Manual "tweaks" is likely to cause problems because of broken layouts.

Avatar

Community Advisor

Hi @user07108 , It might cause you problems in future if you just add an Image in the HTML section of the Text Component. Instead, Develop a custom Image Component with JS handling dimensions. 

here I give you one such HTL code, please write your own JS & CSS as per your needs.

<div class="ColumnImage">
    <div class="imagecontainer"
        data-sly-use.image="com.adobe.cq.wcm.core.components.models.Image"
        data-sly-use.templates="core/wcm/components/commons/v1/templates.html"
        data-sly-test="${image.src}">${image.src}"
    </div>
</div>
    
<div class="ColumnText">
    <div class="textcontainer col-md-12 text-center">
        <h2>${properties.textTitle}</h2>
    </div>
</div>

~Hope this helps,

Aditya.Ch

Thanks,

Aditya Chabuku