0

I want to get specific image info in the sourcecollection: if original imagewidth < 1040px it should give a datakey which has the original width, so I tried to get the original width

maxW < TSFE:lastImageInfo|0

and other differnet methods, but it seems it only catches Labels not the values. see example "small". TSRef says width, maxW ... has stdWrap capabillities, so how can I get the values?

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

    }
}
  • will be rendered as srcset

1 Answers1

0

You have to use .data in maxW when you want to use registred values. In your if condition you have used .data correctly...

maxW.data = TSFE:lastImageInfo|0
René Pflamm
  • 3,273
  • 17
  • 29
  • yes, but regardless of using maxW.cObject = TEXT maxW.value = XXX or maxW.data = TSFE:lastImageInfo|0 or maxW < someObject it only accepts Strings and if pointing to an object I get the name of the object, even when setting maxW.insertData = 1 – user3699049 Jan 03 '17 at 08:48
  • If you first set `maxW.cObject` and then overwrite it with `smallest.maxW < TSFE:lastImageInfo|0` it will not work. `smallest.maxW >` and `smallest.maxW.data = TSFE:lastImageInfo|0` would be the correct way. – René Pflamm Jan 03 '17 at 08:55
  • yes, I did try a lot of different ways, which I forgot to erase, but my problem is that it only workes with setting to string not using getData, smallest { width = 320 maxW.cObject = TEXT maxW.cObject.value = 4444 // -> null } # – user3699049 Jan 03 '17 at 09:19