Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] HTML in label custom field is overridden

9 years 2 months ago - 9 years 2 months ago #268876 by jj.willemsen
CB 2.0.10

When I included HTML in the label of a custom field like <U>Test</Test> this is not stored in the database, only Test is stored then. If I want to include HTML in the label, how can I do that?

Johan
Last edit: 9 years 2 months ago by nant.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 2 months ago #268910 by krileon
Replied by krileon on topic HTML in label custom field is overridden
Don't add HTML directly to titles. Use a language string. For example you'd have _MY_FIELD_TITLE. Then in your CB language files you'd translate it as follows for example.

'_MY_FIELD_TITLE' => '<strong>My Label!</strong>'

Regardless we don't have any filtering being applied to the title so I've no idea why your HTML is being removed on store for field titles. I am unable to duplicate your issue. It will for Name though as Name isn't meant or used for display.

If you're meaning for field option labels then yes they will remove HTML, because a select dropdown can't have HTML in it and that code is generalized for select, multiselect, radio, and multicheckbox fields. If you want HTML in a multicheckbox field option label for example you'll need to use the language string usage suggested above.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nant

Please Log in or Create an account to join the conversation.

9 years 2 months ago #268978 by jj.willemsen
Replied by jj.willemsen on topic HTML in label custom field is overridden
thanks Kyle, using the language files works fine
The following user(s) said Thank You: nant

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum