本文介绍了在TypoScript中获取FlexForm配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从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
}
}
}
在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配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!