0

我正在尝试在 TYPO3 中使用不同的前端布局。所以我正在使用这个花哨的 TypoScript:

page {
    bodyTag = <body>

    10= CASE
    10.key.field=layout
    # Standardtemplate
    10.0 = TEMPLATE
    10.0.template = FILE
    10.0.template.file = fileadmin/template/content_template.html
    10.0.workOnSubpart = DOCUMENT_BODY

    # Variante 1:
    10.1 = TEMPLATE
    10.1.template = FILE
    10.1.template.file = fileadmin/template/index_template.html
    10.1.workOnSubpart = DOCUMENT_BODY

    includeJSFooter {

    jquery = fileadmin/template/js/jquery.js
    bootstrap = fileadmin/template/js/bootstrap.min.js
    app = fileadmin/template/js/app.js

  }

  includeCSS {

    robotoFont = https://fonts.googleapis.com/css?family=Roboto:100,400
    robotoFont.external = 1
    robotoFont.media = all

    bootstrapCore = fileadmin/template/css/bootstrap.min.css
    bootstrapCore.media = all


  }
}

这还不行。每一页都是完整的。只出现一个白页。我正在使用 TYPO3 7.6.16。我上面的代码有什么问题吗?

4

2 回答 2

0

它认为您正在寻找它,只需将其放在 PAGE-Element 中并重命名路径,并在布局 1.2.3 中创建一些名为 value 的 BackendLayouts。例如,希望这会有所帮助:

10 = FLUIDTEMPLATE
    10 {
            file = fileadmin/templates/Page/Standard.html

            partialRootPath =  fileadmin/templates/Partials/

            variables {

                    layout = CASE
                    layout {
                            key.field = backend_layout
                            key.ifEmpty.data = levelfield:-2, backend_layout_next_level, slide

                            1 = TEXT
                            1.value = startpage

                            2 = TEXT
                            2.value = subpage

                            3 = TEXT
                            3.value = subpagespecial

                            default = TEXT
                            default.value = subpage
                    }

                    content = CONTENT
                    content {
                            table = tt_content
                            select.orderBy = sorting
                            select.where = colPos=0
                            select.languageField = sys_language_uid
                            select.includeRecordsWithoutDefaultTranslation = 1
                    }

                    header = CONTENT
                    header {
                            table = tt_content
                            select.orderBy = sorting
                            select.where = colPos=1
                            select.languageField = sys_language_uid
                            select.includeRecordsWithoutDefaultTranslation = 1
                    }
                    content2 = CONTENT
                    content2 {
                            table = tt_content
                            select.orderBy = sorting
                            select.where = colPos=3
                            select.languageField = sys_language_uid
                            select.includeRecordsWithoutDefaultTranslation = 1
                    }
                    contentfull = CONTENT
                    contentfull {
                            table = tt_content
                            select.orderBy = sorting
                            select.where = colPos=2
                            select.languageField = sys_language_uid
                            select.includeRecordsWithoutDefaultTranslation = 1
                    }
            }
    }
于 2017-04-05T12:50:34.857 回答
0

请在 CASE 对象中添加默认变体。可能是重新创建的页面在其“布局”列中没有“0”。

您是否确认子部分标记拼写正确?

<!-- ###DOCUMENT_BODY### begin --> 
Your HTML template
<!-- ###DOCUMENT_BODY### end --> 

您可以简化您的 TypoScript 模板:

page {
    10 = TEMPLATE
    10.template = FILE
    10.template.file = CASE
    10.template.file {
        key.field = layout
        default = TEXT
        default.value = fileadmin/template/content_template.html
        1 = TEXT
        value = fileadmin/template/index_template.html
    }
    10.workOnSubpart = DOCUMENT_BODY
}
于 2017-04-05T22:14:57.967 回答