Wednesday, May 23rd

Last update05:36:30 AM GMT

Font Size

Screen

Profile

Layout

Menu Style

Cpanel
Welcome, Guest
Username Password: Remember me

Article/Module Titles Tag
(1 viewing) (1) Guest
Got a Joomla problem? Post as much detail about it as you can here to see if you can get a solution.

Where possible, include URL for the site or page having issues, what version of Joomla you're using, what type of server (eg Cpanel, WAMP, IIS), what components may be installed, and specific error messages you're encountering.

If you think your problem is particularly obscure, you might be better posting it to the forums at joomla.org as there's thousands more people to help you.
  • Page:
  • 1

TOPIC: Article/Module Titles Tag

Article/Module Titles Tag 10 months ago #4556

Anthony & myself are currently delving into the wonderful world that is custom Joomla! template development. We're keen to get one particular feature running in our sites, and that is the ability to wrap span tags around the first word in our article and module headings. I found this tutorial, but haven't had much success as yet:

virginsoft.net/joomla-tutorials/how-to-c...e-in-joomla-1.5.html

I copied the html folder from the Beez template to our template directory, and then copied the code straight from the tutorial into the modules.php file. As per the instructions, I also updated our jdoc:include statements to include the style="xhtmlwithcolor" parameter. From what I can gather, the PHP code that is added to the modules.php file seems to break the site, causing it not to load. As soon as I remove that code, the site loads OK again.

Anybody successfully managed to add this feature to a template in the past?

Cheers,

Chris

Re: Article/Module Titles Tag 10 months ago #4557

  • Partic
  • OFFLINE
  • Moderator
  • Posts: 341
  • Karma: 21
Chris,

Though creating template overrides might make it simpler long term, especially with lots of articles and modules, a simpler method may be to use ReReplacer: www.nonumber.nl/extensions/rereplacer

This component will let you search and replace using a system plugin - all you need to do is specify the text to find, and you can use regular expressions, and then what to replace it with.

I'm not great on regular expressions, so you can do your homework on them yourself (the NoNumber site has a few links and a cheat sheet), but a basic example on this site would be replacing the Module title for the Joomla! User Groups module.

In the component, you would specify this in the search field:
<span>Joomla! User Groups</span>

Then this in the replace field would format the title differently (formats Joomla! in green):
<span style="color:#00DD00">Joomla!</span><span>User Groups</span>

Set it to search everywhere, and check a few other settings, and you would then have your module title replacing. With a combination of changes to your module layout in your template, and regex, you should be able to wildcard the search process to change it all in one ReReplacer instance. Similarly with the article titles, though if you're using linkable titles, some more RegEx thought would be needed to work around the link tags as part of the title.


[MOD] Moved to Help and Troubleshooting forum.
Patrick Jackson
www.kpsystems.com.au
Ask Anything Joomla and I'll helpfully tell you where to go
  • Page:
  • 1
Moderators: Partic
Time to create page: 0.39 seconds
You are here: Forum