[TYPO3-english] Image Content Element as Body Background

JoH asenau info at cybercraft.de
Thu Jul 24 19:47:31 CEST 2014


Am 24.07.2014 18:16, schrieb Scotty C:
> Hi again everyone,
>
> I'd like to take an image content element, supplied by the user in a
> reserved column, and make it the background of the HTML body tag. My
> (very rough) thinking is:
>
> Page.10 = IMAGE
> page.10.value < styles.content. getleft
> Page.Bodytag = <body style="background-image: url( THE IMAGE FROM ABOVE
> GOES HERE);">

You are on the right track, but using styles.content.getLeft won't help 
here, since it will return <img> tags where you actually just want the URL.

page.bodyTagCObject = TEXT
page.bodyTagCObject {
   value = path/to/my/default/image.jpg
   override.cObject = CONTENT
   override.cObject {
     table = tt_content
     select {
       where = colPos = 1
       max = 1
     }
     renderObj = IMG_RESOURCE
     renderObj {
       #image setup here
     }
   }
   wrap = <body style="background-image:url(|);">
}

"Image setup here" depends on the method you are using to upload and 
save the image.
You will find several resources on how to render it correctly :-)

HTH

Joey


-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com


More information about the TYPO3-english mailing list