0

In my Liferay fragment I have created an editable tag via Fragment Specific Tags and Freemarker code to make it editable to the page editor. The code looks like this:

<a href="#placeholder" 
 data-lfr-editable-id="my_id" 
 data-lfr-editable-type="link"
>Placeholder</a>

Additionally to the <a> tag I want to render a Web Component on the same page and reuse the data from the Fragment Specific Tag (the href, the link label, the target - basically everything that is stored via data-lfr-editable-id).

What I am searching for is a way to access the data referenced by the data-lfr-element-id. The pseudo code could look something like this (getFragmentSpecificTagById() is a placeholder for the code that I am looking for):

[#assign myHref = getFragmentSpecificTagById("my_id").href]
[#assign myLabel = getFragmentSpecificTagById("my_id").label]
<my-button
 href="${myHref}"
 label="${myLabel}"
></my-button>

Your help is highly appreciated.

asked Mar 26, 2025 at 17:37

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.