[TYPO3-english] FLUIDTEMPLATE: render different wraps around Content Elements using CASE key.field = layout

Angelika Krage a.krage at orangemango.de
Fri Nov 21 13:36:32 CET 2014


Hi all,

I need to use the layout field of CONTENT ELEMENTS next to backend layouts for rending my individual colPos as variables using FLUIDTEMPLATE in a Typo3 6.2 instance.

The backend-layout selection and rendering for pages works like a charme.
What I cannot get working is the frontend rendering switch of each individual CE of a colPos using the layout field in the appearance tab.

Here is my typoscript that I tried so far. It is an adaption of a snippet that works with the old MARKER/SUBPART templating method  I used to use and which worked.

Any help is much appreciated. 


page = PAGE
page.typeNum = 0

page.5 < plugin.tx_httpsenforcer_pi1

page.10 = FLUIDTEMPLATE
page.10 {
    format = html
    file = fileadmin/templates/layouts/main_layout.html
    partialRootPath = fileadmin/templates/partials/
    layoutRootPath = fileadmin/templates/layouts/
    variables {
        pageContent < styles.content.get
        pageContent.select.where = colPos = 0
        pageContent.renderObj.stdWrap.innerWrap.cObject = CASE
        pageContent.renderObj.stdWrap.innerWrap.cObject {
            key.field = layout
            default = TEXT
            default = <div class="default">|</div>
            1 = TEXT
            1 = <div class="grey-background">|</div>
        }

        sidebar1 < styles.content.get
        sidebar1.select.where = colPos = 1
        
        sidebar2 < styles.content.get
        sidebar2.select.where = colPos = 2       
    }
}

page.10.file.stdWrap.cObject = CASE
page.10.file.stdWrap.cObject {
    key.data = levelfield:-1, backend_layout_next_level, slide
    key.override.field = backend_layout
    
    default = TEXT
    default.value = fileadmin/templates/contentpage-1-margin-col.html
    1 = TEXT
    1.value = fileadmin/templates/contentpage-1-margin-col.html
    2 = TEXT
    2.value = fileadmin/templates/contentpage-2-margin-col.html
}


More information about the TYPO3-english mailing list