Legacy Knowledge Base
Published Jul. 2, 2025

How to make the image as clickable with the link in fragments?

Written By

Thanga Meena

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

  • How to make the image as clickable with the link in fragments?

Environment

  • Liferay DXP 7.1
  • Liferay DXP 7.2

Resolution

Please note: The following information involves customizations or implementation ideas that are beyond the scope of Liferay Support.  Please exercise appropriate discretion in the use of this information to choose to follow it. 

  • In 7.1, there is no OOTB option is available to have an editable image with a link.
    • This may be achieved using the below steps that are hardcoded in the fragment HTML.
  • Test case: 
    • Create a fragment collection using the file content 
    • Add the anchor tag as there is no OOTB option or tags available to link it.
    • Observed behavior: It's redirecting to the URL while clicking on the image. 
    • Example:
<a href="http://www.google.com">
<lfr-editable id="01-01-image" type="image">
<img alt="Responsive Image" class="w-100" src="xxx">
</lfr-editable>
</a>
  • Important pointers:
    • It’s important to note that the content inside <lfr-editable> tag is always interpreted as a default value for that editable element.
    • That’s why you can’t put any additional markup around the image or nesting the lfr-editable tags

Additional Information

DXP_72.png

Did this article resolve your issue ?

Legacy Knowledge Base