Show image alt text (asset title) on dialog field | Community
Skip to main content
Level 2
August 2, 2021

Show image alt text (asset title) on dialog field

  • August 2, 2021
  • 2 replies
  • 1949 views

Hi All,

 

I have a requirement where author can provide the alt text on dialog field or when the checkbox is clicked, alt text will be the image title.

I am able to set everything fine, but i also want to show the dropped image title on the dialog field. Is there any way to show the image title on dialog field other than making a ajax call through JS (I cannot do it as it is blocked).

 

Also whenever different image is dragged and dropped, I have to show its corresponding image title as alt text.

 

Thanks,

Santhosh

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Umesh_Thakur
Community Advisor
Community Advisor
August 2, 2021

Hi @santhoshd ,

Image core component is doing the same thing. either you can create a proxy component of it or take it as reference for your custom component.

See the below image component user guide 

https://experienceleague.adobe.com/docs/experience-manager-core-components/using/components/image.html?lang=en

And

https://www.aemcomponents.dev/content/core-components-examples/library/page-authoring/image.html

 

If you want to create proxy of it see the below article:

https://experienceleague.adobe.com/docs/experience-manager-core-components/using/get-started/using.html?lang=en#create-proxy-components

 

Hope this will help.

Umesh Thakur

santhoshdAuthor
Level 2
August 3, 2021

Hi @umesh_thakur ,

 

Thanks for your reply.

 

We have a proxy component and I tried that as well. But it is not working. Under my custom component I am just saving the image path as property and from the sling model i am returing the assettitle (Which is working fine).

Whenever an image is dragged and dropped, under a textfield in dialog i have to show its Title (To notify author the image title that will be used). If second image is dropped, textfield has to update and show the title of second image.

 

I also tried setting value of the textfield as below but it is giving nullpointer exception.

 

${not empty video.assetTitle ? video.assetTitle : ''}
 

Thanks,

Santhosh

Umesh_Thakur
Community Advisor
Community Advisor
August 4, 2021
Can you please post your exact requirement and the solution you are using for it? will be helpful to understand
santhoshdAuthor
Level 2
August 5, 2021

I have to show the image title (dc:title) in my dialog field once the author drags and drops an image.