How to use format template inside link template
Author: prav_crownpeak
Publication Date: 7/24/2024 9:11
Hello All,
I want to use format template inside link template, If would more specifically I want to use sup-script for format template inside link template.
Output example - <a, href="www.example.com"> Sample text with <sup>sup-script-text</sup></a>
-
Author: bIT_sosswald - 7/25/2024 7:43
Hi...
Two possibilities here:
- If you know exactly what to format during development, then just use a CMS_RENDER. This should be done, when the Content that should be formatted is maintained in a separate input component.
- If the editor should define what should be formatted use a CMS_INPUT_DOM with configured format templates as an input component. So the editor can define which parts of the content should be formatted in which way.
Greetings
Sandro0 -
Author: hoebbel - 7/25/2024 8:40
Hello prav,
a short comment on Sandro's solution #2. If you use a CMS_INPUT_DOM input component for the link text, it cannot be displayed in the surrounding input component (e.g. CMS_INPUT_LINK or CMS_INPUT_DOM). To define this display text, an input component must be selected on the properties tab. CMS_INPUT_DOM is not supported here.
In this case, you should either write a value service that transfers the content of the DOM to a CMS_INPUT_TEXT input component or offer a corresponding input component that the editor uses for the display. Of course, this is only relevant if the display of the link text is required in the external input component.Best regards
Holger0 -
Author: ncbruckner - 8/27/2024 15:05
You could use a richtext field for the link label and parse the value to get the result you need.
0
Please sign in to leave a comment.
Comments
3 comments