【问题标题】:TYPO3 8.7.1 templating problemsTYPO3 8.7.1 模板问题
【发布时间】:2017-05-25 18:33:04
【问题描述】:

我几天前开始使用 TYPO3 8.7.1 - 之前没有 TYPO3 的经验。

我现在正在使用 t3editor 使用官方页面上提供的指南创建第一个测试模板,该指南适用于版本 7。这两个版本之间的模板是否存在巨大差异,因为我我只得到一个空白页面,甚至我的源代码在正文标签之间也没有显示任何内容。

# Default PAGE object:
page = PAGE

# Define that we use a Template and where it is located
page.10 = TEMPLATE

page.10 {
template = FILE
template.file = fileadmin/tmp/home.html
}

# Insert shortcut icon in the head of the website
page.shortcutIcon = fileadmin/img/favicon.ico

# Insert stylesheet in the head of the website
page.includeCSS.base = fileadmin/css/style.css

在那张纸条上,我还有一个问题。我似乎找不到 t3editor 使用的突出显示颜色的规律性,但同时我在这个 sn-p 中找不到任何错误。

有人可以帮忙吗?

最好的问候

【问题讨论】:

  • 您没有定义任何子部分。因此,模板中的正文标记之间的所有内容都被删除,并且没有插入任何内容。我建议切换到 FLUIDTEMPLATE 作为现代模板版本。

标签: typo3 templating t3editor


【解决方案1】:

FLUIDTEMPLATE 示例:

在 TypoScript 设置中:

page = PAGE
page {
    10 = FLUIDTEMPLATE
    10 {
        template = FILE
        template.file = fileadmin/Templates/Html/Page/Templates/Default.html
        layoutRootPath = fileadmin/Templates/Html/Page/Layouts/
        variables {
            content < styles.content.get
        }
    }
}

fileadmin/Templates/Html/Page/Layouts/Default.html

<f:render section="Main" />

fileadmin/Templates/Html/Page/Templates/Default.html

<html>
<head>
    <title>Page Template Default</title>
</head>
<body>
<f:layout name="Default"/>

<f:section name="Main">
            <f:format.raw>{content}</f:format.raw>
</f:section>
</body>

然后插入内容并显示页面。

【讨论】:

  • Danke für die Antwort,werd 的 probieren。 Gibt es fürs 流体模板 auch ein 教程,denn dein Codebeispiel verstehe ich nur sehr schwer。 :)
  • 简单的谷歌搜索:typo3流体教程
猜你喜欢
  • 2018-02-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-29
  • 1970-01-01
  • 2021-09-01
相关资源
最近更新 更多