TYPO3 show content from subpages inlcuding css cla

2019-02-19 15:35发布

With the following typoscript I get all content from the subpages on one page:

lib.allPid = COA
lib.allPid {
  10 = HMENU
  10 {        
    special = directory
    special.value = 2
    1 = TMENU
    1 {
      expAll = 1
      NO.doNotShowLink = 1
      NO.allStdWrap.field = uid
      NO.allStdWrap.wrap = |,
    }
    2 < .1
  }
}

lib.allContent = CONTENT
lib.allContent {
  table = tt_content
  select {
    pidInList.cObject < lib.allPid
    leftjoin = pages ON (tt_content.pid = pages.uid)
                where = tt_content.colPos = 0                    
                orderBy = pages.sorting ASC
  }
}

But its not copying the tt_content wrap defined by the layout selectbox in the content element:

tt_content.stdWrap.innerWrap.cObject.default.20.40 = CASE
tt_content.stdWrap.innerWrap.cObject.default.20.40 {
    key.field = layout

    1 = TEXT
    1.value = tag-1

    2 = TEXT
    2.value = tag-2

    3 = TEXT
    3.value = tag-3

    4 = TEXT
    4.value = tag-4

    5 = TEXT
    5.value = tag-5

    6 = TEXT
    6.value = tag-6

    7 = TEXT
    7.value = tag-7
}

I tried to add the wrap to the lib.allContent element like this, but it didn't work:

lib.allContent.stdWrap.innerWrap.cObject.default.20.40 = CASE
lib.allContent.stdWrap.innerWrap.cObject.default.20.40 {
    key.field = layout

    1 = TEXT
    1.value = tag-1

    2 = TEXT
    2.value = tag-2

    3 = TEXT
    3.value = tag-3

    4 = TEXT
    4.value = tag-4

    5 = TEXT
    5.value = tag-5

    6 = TEXT
    6.value = tag-6

    7 = TEXT
    7.value = tag-7
}

Does anybody know how to do this? Thanks in advance!

EDIT: I found a solution (or better: workaround) without typoscript. I insert the contents from the subpages with "New content element - Special Elements - Insert Record" manually one by one. Then, everything is copied. This solutions requires a little more user input but fits perfectly to my needs.

1条回答
在下西门庆
2楼-- · 2019-02-19 16:34

give a try to vhs ViewHelper it'll give you exact output what you want I mean default wrap and at all.

{namespace v=FluidTYPO3\Vhs\ViewHelpers}

<v:page.menu pageUid="2" includeSpacers="0" resolveExclude="1">
    <f:for each="{menu}" as="contentList" iteration="Iteration">
        <div id="uid{contentList.uid}" class="inner-page-content-of-pageUid-2">
            <v:content.render column="0" pageUid="{contentList.uid}" />
        </div>
    </f:for>
</v:page.menu>

something more about vhs ViewHelper

查看更多
登录 后发表回答