【问题标题】:Get FlexForm configuration in TypoScript在 TypoScript 中获取 FlexForm 配置
【发布时间】:2017-03-30 05:38:46
【问题描述】:

我需要从pi_flexform获取page.headerData的typoscript。如何实现我的要求?

page = PAGE
page {
  headerData {
    10 = TEXT
    10.value =<script>/**********************/</script>
  }
}

【问题讨论】:

    标签: typo3 typoscript extbase


    【解决方案1】:

    我不太确定您真正需要什么。我您想在 TypoScript 中访问 FlexForm 配置?

    从 8.4 版开始,这可以通过使用纯 TypoScript 来实现

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

    flexform 后面是包含 flexform 数据的字段和应检索其内容的属性的名称。

    在 8.4 之前您需要使用 userFunc 并使用 PHP 检索值

     $flexFormService = GeneralUtility::makeInstance(FlexFormService::class);
     $flexFormKey = str_replace('.', '|', $keyParts[1]);
     $settings = $flexFormService->convertFlexFormContentToArray($flexFormContent); 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-24
      • 1970-01-01
      • 2017-01-24
      • 2013-02-19
      • 1970-01-01
      • 2014-01-16
      相关资源
      最近更新 更多