簡體   English   中英

TYPO3 / Typoscript:從頁面屬性獲取媒體

[英]TYPO3 / Typoscript : get the media from page properties

我正在使用Typo3 6.2,並且在“資源”字段t中有一個包含媒體(圖片)的頁面:

在此處輸入圖片說明

我正在嘗試在Typoscript中獲取圖片,我相信我必須使用{field:something_here}之類的屬性,但我不知道該使用哪個屬性?

編輯:

我已經嘗試過了,但是沒有成功(什么都沒有產生):

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

和這個 :

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

和這個 :

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

..上面的這段代碼產生了圖片( http://www.mycompany.com/typo3conf/ext/news/Resources/Public/Icons/news_domain_model_news_add.png )但沒了!

問題解決了 !

經過數小時或研究后,我發現了一個有效的代碼段:

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>
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM