Get FlexForm configuration in TypoScript

前端 未结 1 1506
灰色年华
灰色年华 2021-01-25 14:36

I need to get the page.headerData in typoscript from pi_flexform.How can implement my requirement?

page = PAGE
page {
  headerData {
    10 = TEXT
    10.value =         


        
相关标签:
1条回答
  • 2021-01-25 15:19

    I am not so sure about what you really need. I am guessing you want to access a FlexForm configuration inside your TypoScript?

    Since the version 8.4 this is possible by using plain TypoScript

    lib.flexformContent = CONTENT
    lib.flexformContent {
        table = tt_content
        select {
            pidInList = this
        }
    
        renderObj = COA
        renderObj {
            10 = TEXT
            10 {
                data = flexform: pi_flexform:settings.categories
            }
        }
    }
    

    The key flexform is followed by the field which holds the flexform data and the name of the property whose content should be retrieved.

    Before 8.4 you need to use a userFunc and retrieve the value by using PHP

     $flexFormService = GeneralUtility::makeInstance(FlexFormService::class);
     $flexFormKey = str_replace('.', '|', $keyParts[1]);
     $settings = $flexFormService->convertFlexFormContentToArray($flexFormContent); 
    
    0 讨论(0)
提交回复
热议问题