What I’m trying to do is to add some HTML tags to my Joomla! module titles. I will need something like this
Some <b>Title</b>
but when I save !Joomla trims the titles and remove all HTML tags.
I’ve check the administrator/com_content, which I think should be responsible for inserting the database data, but I couldn’t find the answer there.
Can anyone help me with this headache?
So I found the solutions. It includes both of the previous answers, so I’m putting a new one here with the correct code.
First of all I need to say, that this solution works only for a fixed amount of words (last one, two, etc.) I need only to have the last one, so I will post an example code with one word.
First as SMacFadyen sad I needed to create a new module structure in my template html folder: /templates/system/html/modules.php file.
Note: If you don’t want to add this new module styling to all templates, but just on one of them you need to put the module.php in your template’s html folder.
The provided by SMacFadyen looks like this:
Then expired by the comments of Hanny I’ve added some php code to match the last word of the title and to store it in a new varibale.The code looks like this:
Note: the
$wrap_tagvariable stores the tag you want. You can put b, em, u and etc. to have different result.The last thing was to replace the displayed title, so I’ve replaced this code:
<h1><?php echo $module->title; ?></h1>with this one:
<h1><?php echo $html_title; ?></h1>The final result was this:
Thanks to everybody for the help.