0
我想在sourcecollection特定圖像信息: 如果原來imagewidth < 1040px也應該給它具有原始寬度的datakey, 所以我試圖讓原來的寬度TYPO3響應img datakey.xxx沒有stdWrap?
maxW < TSFE:lastImageInfo|0
等目前存在的方法,但它似乎只捕獲標籤而不是價值。 請參閱示例「小」。 TSRef表示width,maxW ...具有stdWrap功能,那麼如何獲取這些值?
tt_content.image.20.1.sourceCollection {
small >
smallRetina >
smallest {
width = 320
maxW.cObject = TEXT
maxW.cObject.value = 4444
dataKey = smallest
srcsetCandidate = 320
elementwidth = 320
}
smallest.maxW < TSFE:lastImageInfo|0 // gets null
smaller {
width = 480
if.isLessThan = 439
if.value.data = TSFE:lastImageInfo|0
testparm = testp
maxW < TSFE:lastImageInfo|0 //gets null
dataKey = smaller
srcsetCandidate = 480
elementwidth = 480
}
small {
stdWrap.cObject = COA
stdWrap.cObject {
10 = LOAD_REGISTER
10.intobj2 = COA
10.intobj2 {
10 = TEXT
10.data = TSFE:lastImageInfo|0
}
20 = TEXT
20.insertData = 1
20.data = ghj
}
width = 720
if.isLessThan = 719
if.value.data = TSFE:lastImageInfo|0
maxW = 720
dataKey = small
maxW.insertData = 1
maxW.stdWrap.insertData = 1
maxW.stdWrap.cObject < .stdWrap.cObject.20 // gets "TEXT"!!!
srcsetCandidate = 720
elementwidth = 720
}
...
realSizePic {
width.data = TSFE:lastImageInfo|0
maxW.data = TSFE:lastImageInfo|0
maxW.cObject = TEXT
maxW.cObject.value = testrealsize
#mediaQuery = (min-width: 1100px)
dataKey = biggest
srcsetCandidate.stdWrap.data = TSFE:lastImageInfo|0
/* doesn'T work!!!
srcsetCandidate.cObject = TEXT
srcsetCandidate.cObject {
data = TSFE:lastImageInfo|0
}
*/
elementwidth.data = TSFE:lastImageInfo|0
}
}
- 將呈現爲srcset
是的,但,無論使用 maxW.cObject = TEXT maxW.value = XXX 或 maxW.data = TSFE:lastImageInfo | 0 或 maxW
user3699049
時,如果你第一次'maxW.cObject',然後用其覆蓋' smallest.maxW'和'smallest.maxW.data = TSFE:lastImageInfo | 0'將是正確的方法。 –
是的,我也嘗試了很多不同的方式,這是我忘了刪除,但我的問題是,它只能設置爲字符串不使用的getData, 最小{ 寬度workes = 320 maxW.cObject = TEXT maxW .cObject.value = 4444 // - > null } # – user3699049