Search code examples
typo3-9.x

Sliding og _image typoscript


Here is the typoscript for sliding og image. But its is not working on TyYPO3 9.5.15

page.meta {

    og:image.stdWrap.typolink {
            parameter.stdWrap {
                cObject = IMG_RESOURCE
                cObject.file {
                  treatIdAsReference = 1
                    import {
                        data = levelfield:-1, og_image, slide
                        if.isFalse.field = og_image
                    }
                    height = 650
                    width = 1200c
                }
            }
            returnLast = url
            forceAbsoluteUrl = 1
        }
        og:image:url.stdWrap.typolink {
            parameter.stdWrap {
                cObject = IMG_RESOURCE
                cObject.file {
                  treatIdAsReference = 1
                    import {
                        data = levelfield:-1, og_image, slide
                        if.isFalse.field = og_image
                    }
                    height = 650
                    width = 1200c
                }
            }
            returnLast = url
            forceAbsoluteUrl = 1
        } 

}

What may be the reason. Please help.


Solution

  • You need to declare the field as rootlinefield.

    Go to the ADMIN TOOLS -> Settings -> Configure Installation-Wide Options -> [FE] -> [FE][addRootLineFields] and insert the fieldname.