在TypoScript中获取FlexForm配置 [英] Get FlexForm configuration in TypoScript
问题描述
我需要从pi_flexform获取打字错误的page.headerData.如何实现我的要求?
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 =<script>/**********************/</script>
}
}
推荐答案
我不确定您真正需要什么.我正在猜您要在TypoScript中访问FlexForm配置吗?
I am not so sure about what you really need. I am guessing you want to access a FlexForm configuration inside your TypoScript?
从8.4版开始,可以通过使用普通的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
}
}
}
键
flexform
之后是保存弹性格式数据的字段和应检索其内容的属性的名称.
The key
flexform
is followed by the field which holds the flexform data and the name of the property whose content should be retrieved.
在8.4之前,您需要使用userFunc
并通过使用PHP检索值
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);
这篇关于在TypoScript中获取FlexForm配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!