TYPO3 onepager全部将所有页面渲染为一个不起作用

时间:2016-12-11 10:35:31

标签: typo3 typoscript typo3-7.6.x

我想将所有页面渲染到模板中以制作onepager

我试试这个:

page.20 = TEMPLATE
page.20.template = FILE
page.20.template.file = fileadmin/design/index.html
page.20.marks{

lib.sectionContent = HMENU
lib.sectionContent {
  1 = TMENU
  1 {
    NO = 1
    NO {
      doNotLinkIt = 1
      stdWrap >
      stdWrap {
        cObject = COA
        cObject {
          if.value = 4
          if.equals.field = doktype
          if.negate = 1
          10 < temp.titleSectionId
          10.wrap = <section id="|">
          20 = CONTENT
          20 {
            table = tt_content
            select {
              pidInList.field = uid
            }
            wrap = <div class="container">|</div>
            renderObj < tt_content
          }
          30 = TEXT
          30 {
            wrap = </section>
          }
        }
      }
    }
  }
}    
    LANGMENU < temp.langMenu 

在模板文件中,我有一个部分###CONTENT###

我希望所有内容都打印在那里。怎么可能?

1 个答案:

答案 0 :(得分:3)

您遇到了嵌套错误。

您的嵌套当前看起来像这样(使用对象浏览器验证):

page.20.marks.lib.sectionContent ...

然而,TEMPLATE处的page.20对象仅检查.marks.*中的密钥,并期望在那里配置有效的内容对象(cObject)。但是,有效密钥lib没有设置cObject

你真正想做的是:

# prepare configuration for content
lib.sectionContent = HMENU
lib.sectionContent {
  1 = TMENU
  1 {
    NO = 1
    NO {
      doNotLinkIt = 1
      stdWrap >
      stdWrap {
        cObject = COA
        cObject {
          if.value = 4
          if.equals.field = doktype
          if.negate = 1
          10 < temp.titleSectionId
          10.wrap = <section id="|">
          20 = CONTENT
          20 {
            table = tt_content
            select {
              pidInList.field = uid
            }
            wrap = <div class="container">|</div>
            renderObj < tt_content
          }
          30 = TEXT
          30 {
            wrap = </section>
          }
        }
      }
    }
  }
} 

# initialize configuration for the default page object
page.20 = TEMPLATE
page.20.template = FILE
page.20.template.file = fileadmin/design/index.html
page.20.marks{
    # copy the configuration from above to the right place
    CONTENT < lib.sectionContent
    # I really hope that you prepared temp.langMenu beforehand
    LANGMENU < temp.langMenu 
# close block for page.20.marks
}