typo3 add image resource as background

609 Views Asked by At

I'm totally new to typo3, I need to make a div with background from a specific page. For example on home page, I would like to use a media resource from page id 20.

I got something like that

page.20 = TEMPLATE
page.20.template = FILE
page.20.template.file = fileadmin/refood/layouts/home.html
page.20.workOnSubpart = DOCUMENT
page.20.subparts{
  BOX1 < styles.content.get
  BOX1.select.where = colPos=1
  BOX1.wrap = <div class="offers"><div class="home-box-desc"></div><div class="home-box-desc">|</div><div class="meta-square-green"></div></div>
  BOX1.stdWrap.typolink.parameter = 14 _self home-box }

I tried to use something like that

  references {
     table = pages
     uid.data = 20
     fieldName = media
    }
     renderObj = IMAGE
     renderObj {
      file.import.data = file:current:publicUrl
      altText.data = file:current:title
      wrap = <div class="offers">|</div>
    }
    BOX1.wrap = <div class="home-box-desc" style="background:url(|)"></div>

Into a subpart part, but nothing happens. How should I make it ?

0

There are 0 best solutions below