|
Wrap first word of module title in a span for styling

module-title-styling.png

You may wish to add a little visual excitement to your module titles by adding a different color, font, weight or size to the first or even last word, and do so dynamically. Well this little coding bit will make it happen.

Most likely there is already a modules.php override file within your template's HTML folder. Add the following to each modChrome_ function you wish to enable alternate titling.

$modtitle = $module->title;
$titletext = explode(' ', $modtitle);
$titletext[0] = ''.$titletext[0].'';
$modtitle = implode(' ', $titletext);

Now within the title tags replace $module->title with $modtitle

So the finished coding should look as below

function modChrome_xhtml($module, &$params, &$attribs)
{
$modtitle = $module->title;
$titletext = explode(' ', $modtitle);
$titletext[0] = ''.$titletext[0].'';
$modtitle = implode(' ', $titletext);

if (!empty ($module->content)) : ?>
showtitle != 0) : ?>

content; ?>

Now just add the styling for the .moduletable h3 span tags to your css as desired.

CMSEnergizer

 

Copyright © 2018 CMSEnergizer.com. All Rights Reserved.
This website is powered by the Joomla!©™ 3 Website Framework | File download and article manager component by CMSE Custom Fields | Advanced Module Manager and Modules Anywhere by NoNumber Elements | Website hosting and development by WebsiteDons

CMSEnergizer.com is owned and operated by Emuzement Net Inc, Tampa, Florida USA