Adding the correct icons to files in groups

0
No votes yet

Edit: I need to add a caveat that this only works for browsers
that properly support CSS2. It works well with Firefox & Opera, but
IE6 of course fails. Maybe IE7 will work better.

Adding the following CSS styles will automatically add the correct icons to the files in Luminis Groups. Also useful when you are linking to a group file in a Personal Announcement.

/* UoN customisations in file $CP_HOME/webapps/luminis/misc/style.css */
/* DAS 2005-05-04 Added pretty icons */
a[href $=".doc"]{
background: url(http://my.nottingham.ac.uk/media/icons/doc.gif) bottom left no-repeat;
padding-left: 20px;
}
a[href $=".pdf"]{
background: url(http://my.nottingham.ac.uk/media/icons/pdf.gif) bottom left no-repeat;
padding-left: 20px;
}
a[href $=".ppt"]{
background: url(http://my.nottingham.ac.uk/media/icons/ppt.gif) bottom left no-repeat;
padding-left: 20px;
}

...obviously, you can add more icons for different file types as desired.

This will also work for other areas of Luminis if the same code is copied into the correct CSS files - Maybe the next version of Luminis will consolidate all the CSS files and the more of the styling tags will be removed from the HTML - we can hope!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Silly question

I tried this on our dev box and it didn't work (still get the default image for all types). I placed this at the top my style.css file ... I'll try deeper in the file.

I looked at your style.css file (http://my.nottingham.ac.uk/misc/style.css) to see where you placed it in yours, and you don't have it in yours any reason why?

 -Jon

Oops

Hi Jon, In this case I rushed to to speak up without testing on perhaps the most used browser (IE6). Works well on browsers with full CSS support though. My apologies.

- David.