No doubt about usefulness of this component but still I found a major draw-back in it. You can not configure this component to open all external links in new window or tab. Therefore, this component can reduce the stay time of visitor on your website.
To overcome this issue, I had to find a way to open all the external links to a new window. And after spending couple of hours, I realized that instead of changing component's core files, I should dynamically add "target" attribute to all the external links. Therefore, I included following Javascript in the index.php of template.
<script type="text/javascript">
function getElementByClass(theClass) {
var allHTMLTags=document.getElementsByTagName("a");
for (i=0; i<allHTMLTags.length; i++)
{
if (allHTMLTags[i].className==theClass)
{
allHTMLTags[i].target='_blank';
}
}
}
getElementByClass("keyword_extern");
</script>
Make sure that you paste this code in the bottom of template's index.php.
The above code is very easy to understand and self explanatory.
No comments:
Post a Comment