Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6744939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:08:38+00:00 2026-05-26T12:08:38+00:00

What I’m trying to do is to add some HTML tags to my Joomla!

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:08:39+00:00Added an answer on May 26, 2026 at 12:08 pm

    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:

    function modChrome_myCustomModule($module, &$params, &$attribs)
    {
    $doc =& JFactory::getDocument();
    $css  = ".otherClass {}";
    $css .= ".yourClass {}";
    
    $doc->addStyleDeclaration($css);
    
    ?>
        <div>
            <?php if ($module->showtitle != 0) : ?>
                <h1><?php echo $module->title; ?></h1>
        <?php endif; ?> // post your title
        </div>
        <div>
             <?php echo $module->content; ?> // post your module content
        </div>
    
    <?php
    }
    

    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:

    $wrap_tag = 'b';
    $html_title = preg_replace("~\W\w+\s*$~", '<'.$wrap_tag.'>'.'\\0'.'</'.$wrap_tag.'>', $module->title);
    

    Note: the $wrap_tag variable 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:

    function modChrome_myCustomModule($module, &$params, &$attribs)
    {
    $doc =& JFactory::getDocument();
    $css  = ".otherClass {}";
    $css .= ".yourClass {}";
    
    $wrap_tag = 'b';
    $html_title = preg_replace("~\W\w+\s*$~", '<'.$wrap_tag.'>'.'\\0'.'</'.$wrap_tag.'>', $module->title);
    
    $doc->addStyleDeclaration($css);
    
    ?>
        <div>
            <?php if ($module->showtitle != 0) : ?>
                <h1><?php echo $html_title; ?></h1>
        <?php endif; ?> // post your title
        </div>
        <div>
             <?php echo $module->content; ?> // post your module content
        </div>
    
    <?php
    }
    

    Thanks to everybody for the help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.