[TYPO3-english] typoscript: replace string/background url if empty

Muriel le Pair typo3 at strangefruit.nl
Tue Feb 11 17:46:06 CET 2014


jaco graaff schreef op 11-02-14 00:59:
> I use a background image in my website - Typo3 6.1
>
> Previously I was able to use leveluid:-1, slide to incrementally go up
> the page tree until I find a page-ref image OR use a default value:
> url="location/defaultbackground.jpg"
>
> now with FAL I am not successful in either
>
> -------------------------------------PREVIOUS Typo3 4.6 <
> ------------------------------------------
>
> temp.bgimg = IMG_RESOURCE
>     temp.bgimg {
>     #-----default image (if none is found below)
>     file = fileadmin/backgrounds/defaultBackground.jpg
>     #-----per site image
>     file.import = uploads/media/
>     file.import.data = page:media
>     file.import.listNum = 0
> #wrap = ............
> }

Hi Jaco,

It's not well documented but in order to get it working in TYPO3 6.1 you 
need to add treatIdAsReference = 1 (works both for IMAGE and IMG_RESOURCE)

So something like this:

temp.bgimg = IMAGE
temp.bgimg {
   required = 1

   file {
      treatIdAsReference = 1
      import= uploads/media/
      import {
        data = levelmedia: -1,slide
        listNum = 0
        override.field = media
      }
    }
}

--
kind regards,

Muriel le Pair


More information about the TYPO3-english mailing list