0

In my custom component, I have some component configs in the standard config.xml file. There are multiple fieldsets (tabs), each one has its own description.

I would like to add a line of text below a field, including a link to a documentation site. Something like: "Documentation: link". See image below.

enter image description here

I did some googling before coming here. As I understand it, you can not add text to xml file.

Is this possible? How to do it? If not, is it possible to enter a link in the field description (hint on hover)? Or any other suggestions?

Thanks!

1 Answer 1

2

You could try the "spacer" field type and see if that's good enough for your purposes:

<field name="example_spacer" type="spacer" label="Text you want here" />

Then put it in your XML file following the field you're wanting the extra text for. Add CSS to taste.

That might work out for you.

5
  • 1
    This is correct; reading the question, if you still have trouble adding text to xml you may use a translation string. And you can inject the css (and html) inline with the string. Feb 11, 2020 at 7:12
  • @Riccardo I didn't realize you can some html to create a link inside a language string. Thanks! :)
    – TVBZ
    Feb 12, 2020 at 1:45
  • @Arlen Yes. That's what I needed. Great. Thanks!
    – TVBZ
    Feb 12, 2020 at 1:47
  • @TVBZ You also don't need the language string. You can put it directly in the XML. All depends on whether you plan to release the component. I have a dozen custom components that do things specific to the servers I run, most of them don't need to be multi-lingual b/c of the narrow audience they serve, some of those have the text right in the xml file (especially for text strings that only appear in that single place). Glad it helped.
    – Arlen
    Feb 12, 2020 at 14:06
  • @Arlen Thanks for the tip. I will keep it in mind for future components. This one is intented for mulilingual website and management, so I prefer the language strings. :)
    – TVBZ
    Feb 13, 2020 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.