0
votes

I set up my own tt_content layout in TSconfig like

TCEFORM.tt_content.layout.removeItems = 1,2,3
TCEFORM.tt_content.layout.addItems.100 = Green Box

and added the class definition to my typoscript setup like

# Layout Green Box (100)
tt_content.stdWrap.innerWrap.cObject{
    100=<tt_content.stdWrap.innerWrap.cObject.default
    100.15.value = greenbox
}

in TYPO3 CMS 7.6.9. But it nothing happens in the frontend. The Layout "Green Box" appears in the Appearance > Layout dropdown but the class does not.

Did I something wrong or is there a new way since the fluid layouts in 7+ version?

2

2 Answers

0
votes

In fact it needs to be defined in your own fluid template. So what you do is to copy the private folders of fluid_styled_content to your own private folder of your distribution and added some lines to your typoscript constants like

styles.templates {
  templateRootPath = {$resDir}/Private/Tt_content/Templates
  partialRootPath = {$resDir}/Private/Tt_content/Partials
  layoutRootPath = {$resDir}/Private/Tt_content/Layouts
}

In my case I edit the second line of Textmedia.html to

<div id="c{data.uid}" {f:if(condition: '{data.layout} == 100', then: 'class="greenbox"')}>

and et voila it works fine.

0
votes

A little late, but somebody might still find this useful.

If you're using css_styled_content, then yes, it changes slightly in new versions. Basically the structure looks now some like this:

stdWrap.innerWrap.cObject.[default|NN] {
    # 10 - OPEN TAG
    10.cObject.default.value = <div id="c{field:uid}"
    # 20 - CLASS
    20.10.value = csc-default
    # 30 - CLOSE TAG
    30.cObject.default.value = >|</div>
}

Differences between versions:

# overwrite basic settings for selected frame:
stdWrap.innerWrap.cObject.[NN (layout number or default)]

# for open tag:  instead of NN.10.value  (default.10.value)   use:  NN.10.cObject.default.value   (default.10.cObject.default.value)
# for class:     instead of NN.15.value  (default.15.value)   use:  NN.20.10.value  (default.20.10.value)
# for close tag: instead of NN.30.value  (default.30.value)   use:  NN.30.cObject.default.value   (default.30.cObject.default.value)

So in asked case it will be like this:

# Layout Green Box (100)
tt_content.stdWrap.innerWrap.cObject{
    100 =< tt_content.stdWrap.innerWrap.cObject.default
    100.20.10.value = greenbox
}