Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Making Text in an External Plugin HTML Tag Compatible

  • 4creator
  • 4creator
  • OFFLINE
  • Posts: 43
  • Thanks: 6
  • Karma: 1
  • Add-ons
11 months 2 weeks ago - 11 months 2 weeks ago #336459 by 4creator
Hello,

I would like to share some code extracted from a CB plugin developed by an external developer.
Code:
use CBLib\Language\CBTxt; // (Omitted)     // get plugin params     $plugin =  JPluginHelper::getPlugin('jevents', 'jevusers');     if (!$plugin)         return "";     $jevusers_params = new JRegistry($plugin->params);     if ($jevusers_params->get("showattending", 1))     {         $tab_intro = $this->params->get('tabMessage', "JEVENTS_TAB_TEXT_DEFAULT_2");     }     else     {         $tab_intro = $this->params->get('tabMessage', 'UPCOMING_EVENTS_CREATED_BY_THIS_USER_OR_THEY_AREATTENDING');     }     $tab_intro = CBTxt::T($tab_intro);

In the Tab management, I have set CB_JEVENS_NOTE as the tab text parameter for this plugin. I have also set up the text for CB_JEVENS_NOTE in the Plugin management's language override.
Currently, when I input <strong>my text</strong>, the <strong> tags are being output as text. I suspect that $tab_intro = CBTxt::T($tab_intro); is the cause of this. Is it possible to make this code compatible with HTML tags?


Thanks
Last edit: 11 months 2 weeks ago by 4creator.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
11 months 2 weeks ago #336464 by krileon
Your issue would be after that code. You've something applying htmlspecialchars to $tab_intro before display. CBTxt::T just translates it does not remove or convert HTML in any way.


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: 4creator

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

Moderators: beatnantkrileon
Powered by Kunena Forum