2
votes

I'm working on Typo3 6.2 and I have a page with a media (picture) uploaded in the "resource" field t :

enter image description here

I'm trying to get the picture in my Typoscript and i believe i have to use a property like {field:something_here} but I don't know chich one ?

EDIT :

I already tried this, with no success (nothing is generated) :

    5 = FILES
    5 {
    references.data = levelmedia:-1,slide
    references.listNum = 0
    renderObj = TEXT
    renderObj.data = file:current:publicUrl
    }

and this :

    5 = FILES
    5 {
        references {
        table = pages
        uid.data = page:uid
        fieldName = ogimage
        }
        maxItems = 1
        renderObj = TEXT
        renderObj {
        data = file:current:uid
        }
        }
    }

and this :

    5 {
        file.import.data = levelmedia: -1, slide
        file.import = fileadmin/user_upload/
        file.import.listNum = 0
        file.import.override.field = media
    }

.. this code above generate a picture (http://www.mycompany.com/typo3conf/ext/news/Resources/Public/Icons/news_domain_model_news_add.png) but not the good gone !

1
This is a duplicate of stackoverflow.com/questions/32568425/… - you'll find the answer for TypoScript thereOliver Hader
I already tried this way but it doesn't work (see my edit on original topic)Paolito75

1 Answers

4
votes

Problem solved !

After hours or research I found a working snippet :

5=FILES
5.begin = 0
5.maxItems = 1
5.references.table = pages
5.references.uid.data = uid
5.references.fieldName  = media
5.renderObj = TEXT
5.renderObj {
    data = file:current:publicUrl
    wrap = <div class="image-section" style="background-image:url('/|')">&nbsp;</div>
}