Typo3: Sub-page Template not loading

隐身守侯 提交于 2020-01-16 18:36:35

问题


Maybe I'm just missing something ... obviously, and so far I've googled up nothing to help.

the issue, seems simple, I'm just trying to load a "slightly" different for one Page in my Root tree. All other pages share the Root template, but I need for this one page to have a completely different kind of content and a slightly different header, thus the need for a secondary template.

I've done the following for it:

# 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

But all this leads too is a completely blank HTML upon page load. No errors, no nothing! The page source just comes up:

<!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>

So, I suppose the question is, how can I get a single Page to have a separate template?


回答1:


A typical error can be you forgot to include the default page typoscript template because the typoscript object page in your code needs it to show the content or pull it from the database. In the template configuration of template look in the include static typoscript template and include css.styled.content.




回答2:


Don't know if this is correct, but this is what I found to do.

I made my template and placed it in a specific folder. Then I did the following and it works!

# 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>
}


来源:https://stackoverflow.com/questions/16743344/typo3-sub-page-template-not-loading

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!