Path of a picture instead of the img tag

Hallo,

mit <media:image image="{image}" alt="{headline}" /> zeigt es in meinem Template das Bild wunderbar in einem Tag an. Aber wie kann ich das Bild in einem div-Block als background-image auslesen?

Ich bräuchte also nur den Pfad. Kann mir das jemand sagen?

Hab schon in der Dokumentation geschaut, finde mich aber noch nicht richtig zurecht. Das hier hat nicht funktioniert {typo3.media:uri.image(image: imageObject)}

Gruß

Hey Stefan,
I do it with viewHelper like this:
(theoretical code: not tested because lot of other stuff in template and mixins in yaml. But I copy/paste the relevant parts: it works fine in my template)

#template.html

{namespace m=TYPO3\Media\ViewHelpers}
<m:uri.image asset="{yourNodeType.properties.image}"/>
# NodeTypes.yourNodeType.yaml

'Vendor.Site:yourNodeType':
  properties:    
    image:
      type: 'TYPO3\Media\Domain\Model\ImageInterface'
      ...

Hope it will help.
Cheers Martin

(English answer although it is the German Forum: so more people have benefit - @dfeyer asked for it in an other topic)

Many thanks. It don’t work for me (there was an error…), but it show me another way. Here’s my solution:

template.html:

{namespace media=TYPO3\Media\ViewHelpers}
<div class="sj-fullwidth" style="background-image: url({media:uri.image(image: image)});">

In my first post (the question) I had forgotten to change the word “imageObject”, thats all!