在 TypoScript 中获取 FlexForm 配置
Get FlexForm configuration in TypoScript
我需要从 pi_flexform.How 中获取打字中的 page.headerData 可以实现我的要求吗?
page = PAGE
page {
headerData {
10 = TEXT
10.value =<script>/**********************/</script>
}
}
我不太确定你真正需要什么。我猜测你想在你的 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
}
}
}
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
检索值
$flexFormService = GeneralUtility::makeInstance(FlexFormService::class);
$flexFormKey = str_replace('.', '|', $keyParts[1]);
$settings = $flexFormService->convertFlexFormContentToArray($flexFormContent);
我需要从 pi_flexform.How 中获取打字中的 page.headerData 可以实现我的要求吗?
page = PAGE
page {
headerData {
10 = TEXT
10.value =<script>/**********************/</script>
}
}
我不太确定你真正需要什么。我猜测你想在你的 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
}
}
}
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
$flexFormService = GeneralUtility::makeInstance(FlexFormService::class);
$flexFormKey = str_replace('.', '|', $keyParts[1]);
$settings = $flexFormService->convertFlexFormContentToArray($flexFormContent);