Use same lfr-editable element multiple time

thumbnail
Tommaso Matticchio, modified 5 Years ago. New Member Posts: 3 Join Date: 6/26/20 Recent Posts
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 emoticon
Tommaso
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
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