首页 > 解决方案 > TYPO3 空体标签

问题描述

我从 9.5 升级到 10.4,我猜 Typoscript 不能正常工作。没有显示错误(还有日志文件..)

Header 渲染正确,但 Body-Tag 保持为空。

我现在有点迷路了。升级 Typo3 总是一种乐趣。

任何的想法?是否有任何过时的 Typoscript 标签?

config {
    absRefPrefix = /
    disableBodyTag = 1
    metaCharset = utf-8
    prefixLocalAnchors = all
    contentObjectExceptionHandler = 0
}

# HEADER MAINNAV MENU
headermainnav = HMENU
headermainnav {
    entryLevel = 0
    1 = TMENU
    1 {
        wrap = <ul>|</ul>
        NO = 1
        NO {
            wrapItemAndSub = <li>|</li>
        }
        ACT = 1
        ACT {
            wrapItemAndSub = <li class="active">|</li>
        }
    }
    2 < .1
}

# LANGUAGE SELECTOR
languagemenu = COA
languagemenu {
    20 = HMENU
    20 {
        special = language
        special.value = 0,2
        special.normalWhenNoLanguage = 0
        wrap =
            1 = TMENU
        1 {
            noBlur = 1
            NO = 1
            NO {
                doNotLinkIt = 1
                linkWrap = <li>|</li>
                stdWrap.override = DE || EN
                stdWrap {
                    typolink {
                        parameter.data = page:uid
                        additionalParams = &L=0 || &L=2
                        ATagParams = hreflang="de-DE" || hreflang="en-GB"
                        addQueryString = 1
                        addQueryString.exclude = L,id,no_cache
                        addQueryString.method = GET
                        no_cache = 0
                    }
                }
            }
            ACT < .NO
            ACT.linkWrap = <li class="active">|</li>
            USERDEF1 < .NO
            USERDEF1 {
                linkWrap = <li class="text-muted">|</li>
                stdWrap.typolink >
            }
            USERDEF2 < .ACT
            USERDEF2 {
                linkWrap = <li class="text-muted">|</li>
                stdWrap.typolink >
            }
        }
    }
    wrap = <ul id="language_menu" class="language-menu">|</ul>
}

# FOOTER MAINNAV MENU
footermainnav = HMENU
footermainnav {
    entryLevel = 0
    excludeUidList = 2,3,4,5,6
    1 = TMENU
    1 {


        wrap = <ul>|</ul>
        NO = 1
        NO {
            wrapItemAndSub = <li>|</li>
        }
        ACT = 1
        ACT {
            wrapItemAndSub = <li class="active">|</li>
        }
    }
    2 < .1
}


page = PAGE
page {

    # set baseURL on the flow
    headerData.5 = TEXT
    headerData.5.data=getIndpEnv:HTTP_HOST
    headerData.5.wrap = <base href="{$websiteConfig.protocol}://|/"></base>

    meta {
        description = page:description
        viewport = width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no
        X-UA-Compatible = IE=edge
        X-UA-Compatible.attribute = http-equiv
    }

    shortcutIcon = fileadmin/t3/img/favicon.png

    includeCSS {
        googlefontscss = https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,600,600i,800,800i|Oswald:500
        googlefontscss.external = 1

        file1 = fileadmin/t3/css/normalize.css
        file2 = fileadmin/t3/css/grid12.css
        file3 = fileadmin/t3/css/slick.min.css
        file4 = fileadmin/t3/css/style.css
        file5 = fileadmin/t3/custom.css
    }
    includeJS {
        file1 = fileadmin/t3/js/jquery.min.js
    }

    includeJSFooter {
        file2 = fileadmin/t3/js/lottie.min.js
        file3 = fileadmin/t3/js/slick.min.js
        file4 = fileadmin/t3/script.js
        file5 = fileadmin/t3/js/custom.js
    }

    10 = TEMPLATE
    10 {
        template = FILE
        template.file = fileadmin/t3/layout.html

        relPathPrefix = fileadmin/t3/

        workOnSubpart = DOCUMENT

        substMarksSeparately = 1

        marks {

            COPYRIGHT = TEXT
            COPYRIGHT {
                data = date : U
                strftime = %Y
                noTrimWrap = |&copy; | TYPO3 All Rights Reserved.|
            }

            BODYTAG = TEXT
            BODYTAG.insertData = 1
            BODYTAG.dataWrap = <body class="no-touch" data-page="{tsfe:id}">

            CONTACTFORM = CONTENT
            CONTACTFORM {
                table = tt_content
                select {
                    pidInList = 23
                    includeRecordsWithoutDefaultTranslation = 1
                }
            }
            HEADERMAINNAV < headermainnav
            LANGUAGESELECTOR < languagemenu
            FOOTERMAINNAV < footermainnav

            CONTENT = CONTENT
            CONTENT {
                table = tt_content
                select {
                    languageField = 1
                    orderBy = sorting
                    includeRecordsWithoutDefaultTranslation = 1
                }
            }

            NEWSBANNER = CONTENT
            NEWSBANNER {
                table = tt_content
                select {
                    pidInList = 47
                    includeRecordsWithoutDefaultTranslation = 1
                }
            }

            COOKIEHINTCONTENT = CONTENT
            COOKIEHINTCONTENT {
                table = tt_content
                select {
                    pidInList = 14
                    includeRecordsWithoutDefaultTranslation = 1
                }
            }

            IMPRINTCONTENT = CONTENT
            IMPRINTCONTENT {
                table = tt_content
                select {
                    pidInList = 16
                    includeRecordsWithoutDefaultTranslation = 1
                }
            }

            PRIVACYCONTENT = CONTENT
            PRIVACYCONTENT {
                table = tt_content
                select {
                    pidInList = 17
                    includeRecordsWithoutDefaultTranslation = 1
                }
            }

            JOBROWS = CONTENT
            JOBROWS {
                table = tt_content
                select {
                    pidInList = 27
                    orderBy = sorting
                    includeRecordsWithoutDefaultTranslation = 1
                }
            }

            DOWNLOADS_DE = CONTENT
            DOWNLOADS_DE {
                table = tt_content
                select {
                    pidInList = 31
                    where = sys_language_uid = 0
                    languageField = 0
                    orderBy = sorting
                    includeRecordsWithoutDefaultTranslation = 1
                }
            }

            DOWNLOADS_EN = CONTENT
            DOWNLOADS_EN {
                table = tt_content
                select {
                    pidInList = 31
                    where = sys_language_uid = 2
                    languageField = 0
                    orderBy = sorting
                }
            }

            FAQDATA = CONTENT
            FAQDATA {
                table = tt_content
                select {
                    pidInList = 34
                    orderBy = sorting
                    includeRecordsWithoutDefaultTranslation = 1
                }
            }
        }
    }
}

标签: typo3typo3-10.x

解决方案


请记住,在 TYPO3 11 中将删除 TEMPLATE、MARKERS 和 SUBPARTS。

10.template = FILE在 TYPO3 10 中删除。您必须切换到 FLUID。

在此处阅读更多信息:https ://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/ContentObjects/Template/Index.html

10 = FLUIDTEMPLATE
10 {
  # also dynamic with .stdWrap
  templateName = TemplateName
  layoutRootPaths {
      # if you set <f:layout name="Whatever" /> in your template, create Whatever.html there
      10 = fileadmin/t3/Layouts/
  }
  partialRootPaths {
      10 = fileadmin/t3/Partials/
  }
  templateRootPaths {
      # make sure you have TemplateName.html inside (whatever templateName will be)
      10 = fileadmin/t3/Templates/
  }

  variables {
    # use as {copyright} in template
    copyright = TEXT
    copyright{
      data = date : U
      strftime = %Y
      noTrimWrap = |&copy; | TYPO3 All Rights Reserved.|
    }
  }
}

// 未经测试,但应该是正确的


推荐阅读