5

I was searching the internet but without much luck. I need some way to make module titles linkable, and the only thing I found was on Gavick forum archive posted couple of years ago and file doesn't exist anymore. I also didn't find anything in the extension directory.

At this point I'm tempted to remove htmlspecialchars from module template but I would be grateful if someone can point me to an extension that can do that in a proper way.

Thanks!

1
  • 1
    The only way of doing this would be to hack the template overrides as there is no link for you to put on the title. It would be easier to rewrite your design and hide the normal module title Jul 26, 2014 at 21:55

4 Answers 4

4

The easiest way to achieve this is to use the free RokCandy. Create a new macro with something like this:

Macro: [a link="{link}" target="{target}"]{text}[/a]

HTML: <a class="module-title-link" href="{link}" target="_{target}" title="{text}">{text}</a>

Then in your module, add the following as title:

[a link="http://google.com" target="blank"]Google[/a]

Modify the code as needed. You can also style the link using CSS:

.module-title-link {
  text-decoration:none;
}
3
  • This actually doesn't work for module titles.
    – Jinx
    Jul 27, 2014 at 8:31
  • I think something broke in RokCandy in 3.2 (not positive). I had to put the rokcandy code for a popup rokbox popup directly in the database because putting it in the module title field broke the string.
    – Brian Peat
    Jul 28, 2014 at 0:57
  • I just tested the code in a clean Joomla 3 installation, and it worked fine. But the target parameter has to be included (or removed from the macro), or the code will not work. It is also possible that some templates handles module titles differently, and breaks the code.
    – johanpw
    Jul 28, 2014 at 2:10
4

Take a look at something like RokCandy. Rocket Theme uses this in some of their demos to make module titles clickable. I think NoNumber Snippets could probably do the same job. Just create a "formula" that can be placed in the title and it gets replaced with an actual link.

I was going to link to a forum post on Rocket Theme's forums, but it requires a login. Let me know if you want me to expound on this answer and I'll try to make an example.

I mixed up Snippets with ReReplacer. I think ReReplacer could still do the job, but Snippets supports variables. In combo with Sourcer it's even more powerful. All of these plugins are from http://regularlabs.com

2

I know this has already been answered but Sourcerer is also excellent! It's free and available here http://www.nonumber.nl/extensions/sourcerer

I've used it loads of times to do exactly this. From the website;

Sourcerer enables you to place PHP and any kind of HTML style code (including CSS and JavaScript) right into your content! Not only in your articles, but also in sections, categories, modules, components, META tags, etc.

The syntax is pretty simple. Just place {source} and {/source} tags in text area you want the code to appear (like an article or Custom HTML module), and place your code between the tags.

1
  • 1
    I've actually used Sourcer in combo with snippets before. I place the sourcer code in the snippet and call THAT. Much cleaner.
    – Brian Peat
    Jul 28, 2014 at 16:35
0

Why would you want linkable module titles? Where would the links go?? It just doesn't make any sense.

If you want to do this for a specific instance use a custom html module, hide the module title and then place your linked 'title' within the module output, eg:

<h3 class="page-header"><a href="somewhere-else.html">I go somewhere else</a></h3>
4
  • I have several modules on frontpage that show content from different categories. I want people to be able to click on say... "Auto Reviews" and go to the full listing of that category.
    – Jinx
    Jul 28, 2014 at 14:36
  • Then create an override for that module and do that. It would be pretty poor UX though, IMO. How is a user supposed to know what will happen there? Better to place a link after the module output; ‘See all reviews’. Jul 28, 2014 at 16:28
  • User will get a visual hint. That's what UX is all about. It's just that you as Joomla developer have perception of modules as being non linkable in titles and I can't do anything there :P
    – Jinx
    Jul 28, 2014 at 18:25
  • As a designer and a user, I have the understanding that it should be obvious were links go. If you link a module title that won't be the case; the module is the output source. Jul 28, 2014 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.