[Typo3] Use TypoScript to add an image before every link

Pierre Rossel typo3-l at prossel.com
Tue Aug 30 16:41:37 CEST 2005


Hi,

> Is there a way to use TypoScript to add an image before every link ? The goal
> is to achieve the same result as with the CSS pseudo class "bofore", but to be
> compatible with all browsers.

I adopted a solution that do not depend on Typo for a translation based on a class. Just using the styles below and select them from the list for a link or even for the block that encloses it. For long links that wraps, it looks nicer.

It seems to be OK with recent browsers. I still have to optimize spacing, but if you want an example, look here: 
http://www.gyb.ch/Documents_en_ligne.49.0.html

Tested with:

- Internet Explorer 6 Win
- FireFox 1.0.4 Win
- Netscape 7.2 Win
- Opera 6 Win (icons are vertically centered on wrapped lines)
- FireFox 1.0 Mac
- Safari 1.3.1 Mac
- Internet Explorer 5.2 Mac

If you have different versions (especially older), feel free to report your testings here. If it really works universally (or almost), I will make a FAQ.

Styles:

.icone_download {
	background-image: url(images/iconDownload-small.gif);
	background-repeat: no-repeat;
	background-position: left 0px;
	padding-left: 15px;
}

.icone_lien {
	background-image: url(images/iconMail.gif);
	background-repeat: no-repeat;
	background-position: left 0px;
	padding-left: 15px;
}


> And if it is possible, I would like to have 2 or 3 "styles" (i.e. different
> images) available. Is there a way to select the style for every link in the
> backend ?

Juste add more styles to your stylesheet, they will be listed as well in the drop down lists.
 

- Pierre Rossel (prossel)

-----------------------
This thread is located in the archive at this URL:
http://typo3.org/documentation/mailing-lists/english-main-list-archive/thread/110135978/



More information about the TYPO3-english mailing list