Missing Links - Opening links in a new window
25 Aug 2011 - Written by Paul Hassing
Posted in Tutorials
I strive to make readers stay long and read much.
That said, if I want to:
- expand a point without labouring it or
- refer to a more authoritative source,
Dont worry. Readers who feel valued, respected, educated and entertained will return to your content no matter how many links you offer.
But while they appreciate links, they dont like being booted out of what theyre reading.
This derails their train of thought.
They prefer each link to open in a new window, so they can read deeper if they wish without losing their place.
dictionary beside you. You can look up new words now, later or never.
Its another thing to have a novel ripped from your hands, slammed shut and forcibly replaced with a dictionary.
Thats why I set all my links to open in new windows.
Readers like choice.
They also like to choose how and when they choose.
Give em the right choices, and theyll choose you!
The technical nitty gritty.
How to set links to open in a new window in Joomla.
Joomla has a few options to determine how your links behave once created.
- You can manually set links in your content items using the wysiwyg editor to open the in a new window.
- Menu item links can be set to open in a new window in the menu parameters.
-
You can use a Joomla plugin called mfBlank that targets all links on a page and highlights links that open to another website with a nifty little icon.
- If you want to get your hands dirty you can add some jQuery to your Zen Grid Framework Joomla Template to automatically target links that point to a new domain. The following code comes courtesy of Trevor Davis.
{codecitation}
jQuery("a[href^='http:']").not("[href*='mydomain.com']").attr('target','_blank');
{/codecitation}
To use the code above you obviously need to make sure that jQuery is included on the page and that code is within the document.ready statement and change mydomain.com to match your current domain. But beyond that all external links should now all open in a new window.
blog comments powered by Disqus