【发布时间】:2021-09-29 13:06:19
【问题描述】:
我使用typo3默认表单生成器创建了一个带有表单元素的网站。
在后端,表单按我的意愿显示,但在前端,typo3 只显示 HTML 代码。
我尝试将表单input、label、fieldset 和legend 标记添加到常量变量styles.content.allowTags,但这不起作用。
看起来它只是影响换行符被删除。
还有其他人有这个问题吗? 我该如何解决?
这是我的设置:
lib.contentElement.templateRootPaths.10 = {$website.path}fluid/Templates/
lib.contentElement.partialRootPaths.10 = {$website.path}fluid/Partials/
lib.contentElement.layoutRootPaths.10 = {$website.path}fluid/Layouts/
tt_content.gridelements_pi1 {
templateName.field = tx_gridelements_backend_layout
templateName.ifEmpty = GridElement
layoutRootPaths {
1 = {$website.path}fluid/gridelements/Layouts/
}
partialRootPaths {
1 = {$website.path}fluid/gridelements/Partials/
}
templateRootPaths {
1 = {$website.path}fluid/gridelements/Templates/
}
dataProcessing {
10 = GridElementsTeam\Gridelements\DataProcessing\GridChildrenProcessor
10 {
default {
as = children
}
noflexform < .default
noflexform {
options {
resolveFlexFormData = 0
}
}
}
}
}
page = PAGE
page {
headerData.5 = COA
headerData.5 {
wrap =<title>|</title>
10 = TEXT
10 {
field = title
noTrimWrap = || - {$website.pagetitle}|
}
}
headerData.6 = COA
headerData.6 {
10 = TEXT
10.field = description
10.stdWrap {
wrap =<meta name="description" content="|">
required = 1
}
}
headerData.7 = COA
headerData.7 {
10 = TEXT
10.field = keywords
10.stdWrap {
wrap =<meta name="keywords" content="|">
required = 1
}
}
headerData.10 = TEXT
headerData.10.value (
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<meta name="apple-mobile-web-app-capable" content="yes">
)
typeNum = 0
shortcutIcon = {$website.path}favicon.ico
stdWrap.space=0
config {
baseURL = {$website.stammurl}
}
includeCSS {
screen = {$website.path}css/style.css
screen.media = screen
ckefontawesome = {$website.path}fontawesome/css/all.min.css
ckefontawesome.media = all
ralewayfont = {$website.path}fonts/Raleway/style.css
ralewayfont.media = all
}
10 = FLUIDTEMPLATE
10 {
file = {$website.path}fluid/{$website.template}
variables {
CONTENT < styles.content.get
FOOTER = CONTENT
FOOTER {
table = tt_content
select {
pidInList = {$website.footer}
orderBy = sorting
where = colPos=0
}
}
}
}
}
tt_content.image.dataProcessing.20.maxGalleryWidth = 2600
tt_content.image.dataProcessing.20.maxGalleryWidthInText = 2600
这是我的模板:
<div class="all">
<div class="content">
<f:format.html parseFuncTSPath="lib.parseFunc">
{CONTENT}
</f:format.html>
<div class="clearer"></div>
</div>
<div class="scrolltop"><span class="fa fa-chevron-up"></span></div>
<footer>
<f:format.html parseFuncTSPath="lib.parseFunc">
{FOOTER}
</f:format.html>
</footer>
</div>
【问题讨论】:
-
请添加更多详细信息,您为呈现表单所采取的特殊步骤。在默认设置和没有 3rd 方扩展的情况下,预计不会出现上述行为。
-
我只使用
gridelements作为第 3 方扩展,但我也尝试过停用 gridelents。 -
我尝试将给定的 HTML 代码添加为纯 HTML 元素,结果相同。显示 HTML 代码,而不是呈现的表单。
-
模板看起来如何?你使用 f:format.html 还是 f:format.raw?
-
我已将模板添加到我的帖子中。我使用
标签: forms typo3 typoscript typo3-10.x