Welcome to the new Compass Designs website, powered by Joomla 1.5! The goal of this new site is to be the place to bookmark if you are looking for quality Joomla  tutorials, news and tips.

Breaking your Layout in a Joomla Template

Posted on Feb 20, 2008
Tagged in templatesjoomla 1.5

So I have been working on a new site and wanted to take advantage of RSS feeds to pull content from other sites. This is a great technique, allowing you to show relevant content without having to write it!

The trouble is, you have no control over this content. If something is there that is too long, it will frequently break the layout of a column, making it grow too big or even worse, drop down in a float drop bug.

While getting the two feeds from the other sites I am involved in, there was a link that was too long and making the column stretch. The solution was actually quite simple though.

I just added this CSS

ul.newsfeed {overflow:hidden;}

This meant that any content in a RSS feed module would not overflow in some messy way. This little line might be worth adding to any templates if you use the Joomla RSS feed module.


Comments (4)add comment

Buddy Quaid said:

Overflow is the obvious choice but I don't think it's very elegant. But I just wrote a javascript that you can download that will take all links on the page and shorten them to whatever character count you want and then add '...' to the end. Here is a working page:

Demo

You can get the javascript page here:

Demo

You would include this as a external script or you can copy and paste it in the head of the page and you need to call the function shortenURL() from the onload event of the body tag like so:



If you already have stuff in onload then just put it at the end of the existing stuff seperated by a semicolon like so:



Hope this helps. Feel free to modify it, I'm certainly no javascript expert but thought this would be something I could write.
November 29, 2007 | url

admin said:

Nice one Buddy!

Email the links and I will edit your post to show them properly.... smilies/smiley.gif
November 29, 2007

Buddy Quaid said:

I sent the links through the email contact form on the site, if you need them through here, here they are:

demo link:
http://buddyquaid.com/javascript/javascript.htm

Javascript source:
http://buddyquaid.com/javascript/shortenURL.js

If you could change the word DEMO for the second link to "javascript source" that would be great. I copy and pasted the link and just changed the filename but I forgot to edit the "demo". Thanks!
November 29, 2007 | url

Clau said:

Hello, i think your website looks amazing. Thanks on the overflow:hidden tip, really helpful. See, i'm new in css and joomla and i was trying to get the double menu like in your page. If you can tell me how you did it, or where i can find it, would mean the world to me.
keep up the good work
January 20, 2008 | url

Write comment
You must be logged in to a comment. Please register if you do not have an account yet.

busy

Did you enjoy this Compass Design blog post/tutorial?

Then sign up for regular monthly newsletter. I'll send you great tips on Joomla, email only offers and news from the Joomlasphere.

Email: First Name:

Find more posts tagged with...

RSS Feed For The Joomla Blog


Joomla 1.5 Book

Get the "have to have book" about Joomla 1.5 from Amazon and free access to the companion site, joomlabook.com.

Joomla 1.0 eBook

Get the best selling Joomla 1.0 Admin Manual eBook

Also available in hard copy from
Support independent publishing: buy this book on Lulu.

Who's Here

We have 137 guests and 3 members online