[TYPO3] Make dynamic header image a background image

JoH asenau info at cybercraft.de
Fri Dec 1 11:46:46 CET 2006


> On one of my sites I have a dynamic header image made with TV and
> typoscript like this:
>
> #Header Image
> lib.topimage = IMAGE
> lib.topimage {
>
> # Default image if no image is inserted on the page
>    file = fileadmin/templates/topimages/headerImage3.jpg
>    file.import.data = levelmedia: -1, "slide"
>
> # Folder to upload the userdefined images to
>    file.import = fileadmin/templates/topimages/
>    file.import.listNum = 0
>    file.import.override.field = media
> }
>
> The code generated is:
>
> <div id="grafik-logo">
>   <img src="fileadmin/templates/topimages/headerImage3.jpg"
> width="804" height="227" border="0" alt="" title="" />
> </div>
>
> Is there any way to make the headerimage a background image in stead?
>
> <div id="grafik-logo"
> background="fileadmin/templates/topimages/headerImage3.jpg">
> </div>

You can use IMG_RESOURCE instead.
This will give you "path/to/your/new/image.jpg" only and thus you can put it
into a marker like this:

<div id="grafiklogo" style="background:url(###TOPIMAGE###) no-repeat top
left;">&nbsp;</div>

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com




More information about the TYPO3-english mailing list