Gianpaolo Scrigna
Gianpaolo Scrigna

Reputation: 842

"Menu of subpages" doesn't work in a Typo3 Fluid template while fetching a record from a page

I'm trying to add a "user controlled" footer in the main layout of a Typo3 Fluid based template.
This means that I've added a backend layout with four columns in a special back-end page called "footer page". A user is able to add content elements in those columns using the WEB > PAGE module.
Whenever a user adds a content element (text, text w/images, bullet lists, etc...) in one of the columns, everything works and the content is correctly displayed. But when the user tries to add a special menu content element, the menu isn't displayed and the column container stays empty.

the main layout

<body>
    ...
    <div id="footer">
        <f:cObject typoscriptObjectPath="lib.footer" />
    </div>
</body>

main PAGE typoscript

page = PAGE
page {
    # Regular pages always have typeNum = 0
    typeNum = 0
    10 = FLUIDTEMPLATE
    10 {
        #file = {$filepaths.templates}index_f.html
        partialRootPath = {$filepaths.templates}partials/
        layoutRootPath = {$filepaths.templates}layouts/
        variables {
            ...
            footer < lib.footer
            ...
        }
     }
}

lib.footer typoscript

lib.footer = COA
lib.footer {
    10 = CONTENT
    10 {
        table = tt_content
        select.pidInList = {$contentpage.footerPID}
        select.where = colPos = 901
        select.orderBy = sorting
        stdWrap.wrap = <div id="footer-widget-1" class="col205">|</div>
    }
    20 = CONTENT
    20 {
        table = tt_content
        select.pidInList = {$contentpage.footerPID}
        select.where = colPos = 902
        select.orderBy = sorting
        stdWrap.wrap = <div id="footer-widget-2" class="col205">|</div>
    }
    ...
}

Am I doing something wrong or is it a bug? Typo3 version is 6.0.4

Upvotes: 1

Views: 1074

Answers (1)

Claus Due
Claus Due

Reputation: 4261

You may want to have a look at the VHS extension for TYPO3 - it contains one ViewHelper in particular which would let you render content elements from any column on any page (by UID). It can even render content elements from a list of content element UIDs (which you could specify in TypoScript, select in a FlexForm, make editable in the constants editor etc.):

http://fedext.net/viewhelpers/vhs/Content/RenderViewHelper.html

Many times the ViewHelpers from VHS will let you do exactly the same as TS lets you do, but do so directly in Fluid and with the option to manually control the HTML that is output.

Cheers,
Claus aka. NamelessCoder

Upvotes: 1

Related Questions