Why Joomla?
The mission of this blog is to make using joomla simple.
English French German Italian Portuguese Russian Spanish
Break long linked URLs in content
Posted by: Qasim Virjee on Sunday, 07 January 2007
Print E-mail
(1 vote, average: 1.00 out of 5)

Okay, so this isn't really a complex hack - but its something pretty much every Joomla webmaster can use; a way to limit the length of hyperlinks!... 

All you have to do is include a javascript in your template that will cut the link down in length and then set whatever functional variables you want by editing the script.

NOTE: only *linked* urls will be shortened in length w/this script. 

Now I just need to figure out how to force all URLs in content to be made into links and I'll never worry about URLs breaking my templates ever again! Wink

To insert the javascript into your template, use the following line in the 'head' adjusted or the location where you save the attached script on your server.

<script type="text/javascript" xsrc="shortlinks.js"></script>

Hint: look at the javascript before you use it - you may want to make edits.

[ download shortlinks.zip

Share Link:
Google Del.icio.us Digg Facebook
Comments
Add New Search RSS
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
Please input the anti-spam code that you can read in the image.
 

Friends and collaborators

About the author

[photo of qasim]why joomla? is mainly contributed to by Qasim Virjee - the Principal @ Design Guru

Subscribe

Sign up to our email newsletter to stay in touch - we send it out monthly and never spam.