[TYPO3-english] add style="background-image(); " with IMG_RESOURCE + LOAD_REGISTER?

Jigal van Hemert jigal at xs4all.nl
Tue Aug 30 17:02:23 CEST 2011


Hi,

On 30-8-2011 15:36, Mark Roemermann wrote:
> Hi list, I've been banging my head against a wall with this.  Is there a
> way to create a H1 tag that takes a page title and subtitle, and adds a
> style attribute that is pulled from the page media?
>
> eg:
>
> <h1 style="background: url(page:media)
> no-repeat;>page:title<span>page:subtitle</span></h1>

Not the prettiest solution (I don't like splitting paired HTML tags over 
two properties), but it works:

10 = TEXT
10 {
   data = page:title
   innerWrap = |<span>{page:subtitle}</span>
   innerWrap.insertData = 1
   preCObject = IMG_RESOURCE
   preCObject {
     file {
       import = uploads/media/
       import.data = page:media
       import.listNum = 0
       height = 200
       width = 600
     }
     stdWrap.wrap = <h1 style="background: url(|) no-repeat;">
   }
   postCObject = TEXT
   postCObject.value = </h1>
}


-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert.


More information about the TYPO3-english mailing list