【发布时间】:2016-09-13 03:05:46
【问题描述】:
有没有办法让前端布局决定后端布局、模板文件和列?
目前我有以下代码,可让您设置后端布局并使用适当的模板文件。但是当每个布局有不同的列位置时,这会变得非常混乱。
page.10 = FLUIDTEMPLATE
page.10 {
#format = html
file= fileadmin/templates/example/partials/example_home.html
partialRootPath = fileadmin/templates/example/partials/
layoutRootPath = fileadmin/templates/example/layouts/
variables {
# Assign the Columns
main < styles.content.get
main.select.where = colPos = 0
news < styles.content.get
news.select.where = colPos = 1
}
}
}
# Assign the Template files with the Fluid Backend-Template
page.10.file.stdWrap.cObject = CASE
page.10.file.stdWrap.cObject {
key.data = levelfield:-1, backend_layout_next_level, slide
key.override.field = backend_layout
# Set the default Template
default = TEXT
default.value = fileadmin/templates/example/partials/example_home.html
# Set a second Template
23 = TEXT
23.value = fileadmin/templates/example/partials/example_internal.html
}
【问题讨论】:
-
你的问题不是很清楚。您正在使用 backend_layout。每个 backend_layout 都可以在 FE 中有自己的表示。为什么 FE Layout 应该决定 BE 的样子?我的意思是,通常情况相反。你选择你的 BE 布局,它决定了列,你为此准备了一个 FE 视图。在 Fluid 中,有“布局”可用于此目的,因此您可以从模板中选取不同的部分。
-
@AndrásOttó 好吧,如果我们忘记前端布局部分,如何根据选择的后端布局设置不同的 colPos?
-
@AndrásOttó 另外,如果您有两个使用相同后端布局的不同模板,您会怎么做?
标签: typo3 typoscript fluid typo3-7.6.x