Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Use same lfr-editable element multiple time
Hi all,
I had this case: I wirte a Page Fragment Section that has 2 <img>, placed in different places for different responsive views (in my case, one for lg devices and other for xs devices).
So my question is: there is a way to define only one of this img via the <lfr-editable type="image"> tag and use multiple time?
Thanks
Tommaso
I had this case: I wirte a Page Fragment Section that has 2 <img>, placed in different places for different responsive views (in my case, one for lg devices and other for xs devices).
So my question is: there is a way to define only one of this img via the <lfr-editable type="image"> tag and use multiple time?
Thanks

Tommaso
You could use javascript to populate the second img entry, just read the img src from the first and write it into the second one.
Another option would be to write your own processor. That way, you could have one editable and one regular img tag and you could copy the img src from the editable to the other tag.
https://liferay.dev/blogs/-/blogs/fragments-extension-fragment-entry-processors
Another option would be to write your own processor. That way, you could have one editable and one regular img tag and you could copy the img src from the editable to the other tag.
https://liferay.dev/blogs/-/blogs/fragments-extension-fragment-entry-processors
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™