简体   繁体   English

如何将页面内容插入TYPO3的默认模板中?

[英]How do I insert page content into the default template in TYPO3?

I want to display the same footer content in all pages of my TYPO3 site. 我想在我的TYPO3网站的所有页面中显示相同的页脚内容。 It is followed by the Fluid Template concept. 其次是流体模板概念。 I have created 3 templates. 我已经创建了3个模板。

   1.default template(main.html)
   2.content template
   3.allpage_content template(which need to show in all pages)

Also want that content to be editable in the Rich Text Editor.So I create a page named footer and call the back-end layout(allpage_content.html). 还希望该内容在富文本编辑器中可编辑。因此,我创建了一个名为footer的页面,并调用了后端布局(allpage_content.html)。

For that : 为了那个原因 :

  lib.footer = COA
  lib.footer {
         10 = CONTENT
         10 {
             table = tt_content
             select.where = colPos = 10
             select.orderBy = sorting
             select.pidInList = 15
            }

      }



page.100 = TEMPLATE
page.100.template = FILE
page.100.template.file = fileadmin/templates/main.html
page.100.workOnSubpart = DOCUMENT_BODY
page.100.marks.content < lib.footer

Apart from that backend layouts is also connect with real frontend templates 除了该后端布局外,还与真实的前端模板连接

 footer_left < styles.content.get
 footer_left.select.where = colPos = 10

Please try the below typoscript: 请尝试以下打字稿:

lib.footer = COA
lib.footer {
10 = RECORDS
 10{
  tables = tt_content
  source = 15 #footer page id
 }
}

OR 要么

lib.footer = COA
lib.footer {
 10 = CONTENT
 10 {
 table = tt_content
  select.where = colPos = 0     #column position - 0-normal, 1-left, 2-right, 3-border
  select.orderBy = sorting
  select.pidInList = 15  #footer page id
 }
}

Here's how I do it. 这是我的方法。 You can use temp objects for that (they don't persist). 您可以为此使用临时对象(它们不会持久存在)。 In the example below, only the bodytext (RTE field) is used, nothing else. 在下面的示例中,仅使用正文(RTE字段),没有其他内容。 Content is rendered through lib.parsefunc_RTE, so Links are rendered. 通过lib.parsefunc_RTE呈现内容,因此呈现链接。 I chose to pick only one content element (select.max), but that's up to you 我选择仅选择一个内容元素(select.max),但这取决于您

temp.footer_adr = CONTENT
temp.footer_adr {
   table = tt_content
   select.pidInList = 47
   select.languageField = sys_language_uid
   select.max = 1
   select.begin = 1
   select.selectFields = bodytext
   renderObj=TEXT
   renderObj{
      required=1
      wrap=|
      field=bodytext
      parseFunc = < lib.parseFunc_RTE
  }
}

page.70 = TEMPLATE
page.70 {
    template = FILE
    template.file = fileadmin/templates/main/tmpl/footer.html
    marks {
            FOOTER_ADR < temp.footer_adr
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM