sherin
sherin

Reputation: 1091

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. It is followed by the Fluid Template concept. I have created 3 templates.

   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).

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

Upvotes: 0

Views: 4404

Answers (2)

Urs
Urs

Reputation: 5132

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. Content is rendered through lib.parsefunc_RTE, so Links are rendered. I chose to pick only one content element (select.max), but that's up to you

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

Upvotes: 1

Sankar V
Sankar V

Reputation: 4128

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

Upvotes: 3

Related Questions