2016-01-14 167 views
0

我试图使用t3onepage扩展略有修改,但似乎无法让它的工作。该扩展只适用于单级后端页面结构,但我希望能够添加子页面。Typo3单页内容呈现

在后台我希望有一个干净,易于使用的页面结构是这样的:

Level 1 
    Level 2 
    Level 2 
    Level 1 
    Level 1 
    Level 2 

这是相当标准。此扩展程序收集所有这些页面的所有内容,并将它们合并到一个页面中。我只是在获取Level 2内容时遇到问题。 这里是获取所有Level 1页面的扩展代码,但是如何为Level 2做到这一点?

20 = CONTENT 
20 { 
    table = pages 
    select.orderBy = sorting 

    renderObj = COA 
    renderObj { 
     10 = CONTENT 
     10 { 
      table = tt_content 
      select { 
       pidInList.field = uid 
       orderBy = sorting 
       where = colPos = 0 
      } 

      wrap = <section id="{field:css_id}" class="{field:css_class}">|</section> 
      wrap.insertData = 1 
     } 
    } 

    wrap = <main role="main">|</main> 
} 

生成的HTML代码看起来是这样的:

<section ids, etc>Level 1</section> 
<section ids, etc>Level 1</section> 
<section ids, etc>Level 1</section> 

,我想它有类似:

<section ids, etc>Level 1</section> 
<section ids, etc>Level 2</section> 
<section ids, etc>Level 2</section> 
<section ids, etc>Level 1</section> 
<section ids, etc>Level 1</section> 
<section ids, etc>Level 2</section> 

任何帮助将非常感激。

回答

0

使用此TypoScript添加子页面的内容。你需要在第一个renderObj中放置另一个CONTENT。

lib.onepage { 
    20 = CONTENT 
    20 { 
     table = pages 
     select.orderBy = sorting 
     renderObj = COA 
     renderObj { 
     10 = CONTENT 
     10 { 
      table = tt_content 
      select { 
       pidInList.field = uid 
       orderBy = sorting 
       where = colPos = 0 
      } 
      wrap = <section id="{field:css_id}" class="{field:css_class}">|</section> 
      wrap.insertData = 1 
     } 
     20 = CONTENT 
     20 { 
      table = pages 
      select { 
       orderBy = sorting 
       pidInList.field = uid 
      } 
      renderObj = COA 
      renderObj { 
       10 = CONTENT 
       10 { 
        table = tt_content 
        select { 
        pidInList.field = uid 
        orderBy = sorting 
        where = colPos = 0 
        } 
        wrap = <section id="{field:css_id}" class="{field:css_class}">|</section> 
        wrap.insertData = 1 
       } 
      } 
      wrap = <main role="main">|</main> 
     } 
    } 
} 
+0

@MarkusSchwemer非常感谢你,那正是我想要的。现在我用下面的方式包装整个renderObj: wrap =

|
它的工作原理就是我所需要的。 – user3804467