Typo3 onepage include subpages with their own templates

517 views Asked by At

I have Typo3-Website with a onepage-layout. This Website has several sections (news, portfolio, Slideshow, ... ). Every section has its own specific layout/template. In Typo3 I have this sections as subpages with their own templates. The following code from a tutorial gives me the content of this subpages in the correct order.

lib.sectionContent {
  1 = TMENU
  1 {
    NO = 1
    NO {
      doNotLinkIt = 1
      stdWrap >
      stdWrap {
        cObject = COA
        cObject {
          if.value = 5
          if.equals.field = doktype
          if.negate = 1
          10 < temp.titleSectionId
          10.wrap = <section id="|" class="page-section" style="margin-top: 30px;">
          20 = CONTENT
          20 {
            table = tt_content
            select {
              pidInList.field = uid
            }
            renderObj < tt_content
          }
          30 = TEXT
          30 {
            wrap = </section>
          }
        }
      }
    }
  }
}

But I need the used template too. I need a way to integrate the subpages with their templates into the parent-page/onepage-website.

1

There are 1 answers

2
Bernd Wilke πφ On BEST ANSWER

you need to render the template with the content of that page instead of only the content.

so your 20 should be a template object like this:

20 = FLUIDTEMPLATE
20 {
    file.cObject = CASE
    file.cObject {
        key.field = backend_layout

        1 = TEXT
        1.value = fileadmin/templates/first.html

        default = TEXT
        default.value = fileadmin/templates/default.html
    }

    variables {
        content < styles.content.get
        content.select.pidInList.field = uid
    }
}

be aware to respect also backend_layout_next_level and other than the main column. also prefer template folders (...RootPaths) than immediate filename.