Typo3:未加载子页面模板

时间:2013-05-24 20:42:23

标签: typo3 typo3-6.1.x

也许我只是错过了一些东西......很明显,到目前为止,我还没有任何帮助。

问题,看起来很简单,我只是想在我的根树中为一个页面加载“略微”不同。所有其他页面共享Root模板,但我需要这一页具有完全不同类型的内容和略有不同的标题,因此需要辅助模板。

我已经完成了以下工作:

# Default PAGE object:
page = PAGE

# Define the template
page.10 = TEMPLATE

# Our template is a file
page.10.template = FILE

# Our template file is fileadmin/template/media/media.html
page.10.template.file = fileadmin/template/media/media.html

但是这一切也导致了页面加载时完全空白的HTML。没有错误,没有任何错误!页面源只是出现了:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <!-- 
        This website is powered by TYPO3 - inspiring people to share!
        TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
        TYPO3 is copyright 1998-2013 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
        Information and contribution at http://typo3.org/
    -->
    <link rel="shortcut icon" href="http://192.168.206.11/introductionpackage-6.1.0/fileadmin/template/media/favicon.ico" type="image/x-ico; charset=binary">
    <link rel="icon" href="http://192.168.206.11/introductionpackage-6.1.0/fileadmin/template/media/favicon.ico" type="image/x-ico; charset=binary">
    <title>Media</title>
    <meta name="generator" content="TYPO3 6.1 CMS">

    <link rel="stylesheet" type="text/css" href="typo3temp/stylesheet_15a396fd13.css?1369410324" media="all">
    <link rel="stylesheet" type="text/css" href="fileadmin/template/style.css?1369398600" media="all">
</head>
    <body>
    </body>
</html>

所以,我想问题是,如何让一个页面有一个单独的模板?

2 个答案:

答案 0 :(得分:0)

典型的错误可能是您忘记包含默认页面typoscript模板,因为代码中的typoscript对象页面需要它来显示内容或从数据库中提取内容。在模板的模板配置中查看include静态typoscript模板并包含css.styled.content。

答案 1 :(得分:0)

不知道这是否正确,但这是我发现的。

我制作了模板并将其放在特定的文件夹中。然后我做了以下工作,它确实有效!

# Default PAGE object:
# page = PAGE
page.10 = NULL

page.includeJSlibs.jwplayer = 1
page.includeJSlibs.jwplayer = fileadmin/template/js/jwplayer/jwplayer.js

# Define the template
page.20 = TEMPLATE

# Our template is a file
page.20.template = FILE

# Our template file is fileadmin/template/media/media.html
page.20.template.file = fileadmin/template/media/media.html

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

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

# Work with the subpart "DOCUMENT"
# page.20.workOnSubpart = DOCUMENT

######################################################
#
# Configuration of SUBPARTS
#
######################################################

# Define the subparts, which are inside the subpart DOCUMENT
page.20.subparts {

}

######################################################
#
# Configuration of MARKERS
#
######################################################

# Define the markers inside the subpart DOCUMENT
page.20.marks {
  # Load the logo
  LOGO = IMAGE
  LOGO.file = fileadmin/templates/images/logo.png
  LOGO.altText = Mountain Top

  # Menu 1 cObject
  menu_1 = HMENU
}

# First level menu-object, textual
page.20.marks.menu_1.1 = TMENU
page.20.marks.marks.menu_1.1 {
  # Normal state properties
  NO.allWrap = <li> | </li>
  # Enable active state and set properties:
  ACT = 1
  ACT.allWrap = <li class="active"> | </li>
}

# Second level menu-object, textual
page.20.marks.menu_1.2 = TMENU
page.20.marks.menu_1.2 {
  # Normal state properties
  NO.allWrap = <div class="menu1-level2-no"> | </div>
  # Enable active state and set properties:
  ACT = 1
  ACT.allWrap = <div class="menu1-level2-act"> | </div>
}