The picture tag gets removed from the adaptive image when using alt attribute
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- Editing the published web content by adding the alt attribute in the source code of the image, the picture tag gets removed from the adaptive image.
-
Steps to reproduce:
- Create dummy page
- Create web content:
- Provide a title name
- Insert an image in the body of the content
- Publish it.
- Add the above-published content on the page using the web content display widget
- Inspect the image
-
Observed behavior: It shows the adaptive media image [<picture> tag gets created for the inserted image in the content]
- Edit the web content and add the attribute alt="" in the source code of the image and publish it
- Inspect the image
-
Observed behavior: <picture> tag gets removed and shows with <img> tag. Also, an error has been thrown in UI and in the server log after publishing the edited content.


Resolution
-
The way how this field operates is intended by design according to the LPS-99216 fix in our records.
-
The LPS-127048 has been raised as a feature request for similar functionality. If you are looking for this feature, I would encourage your team to Vote for this ticket and Watch the feature request.
Did this article resolve your issue ?