[TYPO3-english] Image Content Element as Body Background

Scotty C superscotty19 at yahoo.com
Fri Jul 25 18:17:10 CEST 2014


Hi,

Thanks for your continued help. Let me clarify:
path/to/my/default/image.jpg won't work because I don't *have* a path to 
the image. All I know is that it's going to be some image content element 
that the use puts into the "left" column, from fileadmin. That's why I was 
thinking get left.

Am I missing something?
-Scott.


Sent with AquaMail for Android
http://www.aqua-mail.com


On July 25, 2014 5:15:05 AM JoH asenau <info at cybercraft.de> wrote:

> Am 24.07.2014 20:25, schrieb Scotty C:
> > Hi,
> >
> > First and foremost, thanks for the quick reply! Unfortunately that won't
> > work because I don't have an exact path. All I know is, the user will
> > pick "some" image from fileadmin and place it in the left column as an
> > image content element.
> >
> > Can we tweak something to still make your suggestion work?
>
> No need to tweak it, since that is exactly what the code is supposed to do.
> The "value" of the TEXT is just necessary to have a fallback in case
> there is no image element at all.
>
> The rest is exactly the same as if you had used
> "styles.content.getLeft", with just one difference: The renderObj
> defines how to handle the image element in your case, since you don't
> want to get an <img> tag there.
>
> To avoid other content types being considered, you could just modify it
> a bit though:
>
> page.bodyTagCObject = TEXT
> page.bodyTagCObject {
>     value = path/to/my/default/image.jpg
>     override.cObject = CONTENT
>     override.cObject {
>       table = tt_content
>       select {
>         where = colPos = 1 AND CType = 'image'
>         max = 1
>       }
>       renderObj = IMG_RESOURCE
>       renderObj {
>         #image setup here
>       }
>     }
>     wrap = <body style="background-image:url(|);">
> }
>
> Still "Image setup here" depends on the method you are using to upload
> and save the image, since there are different ways to deal with images
> in the currently supported TYPO3 versions.
>
> 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
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english




More information about the TYPO3-english mailing list