0
votes

I want to wrap the image of content element text with image with <div class="col-md-6">if there is bodytext. And wrap them with <div class="col-md-12">if bodytext is empty. This only for the layout default and 8.

tt_content.textpic.20.layout.default {
    value = <div class="csc-textpic csc-textpic-responsive csc-textpic-center csc-textpic-above###CLASSES### has-text clearfix"><div class="col-md-6">###IMAGES###</div>###TEXT###</div>
    override >
    override = <div class="csc-textpic csc-textpic-responsive csc-textpic-center csc-textpic-above###CLASSES### clearfix"><div class="col-md-12">###IMAGES###</div>###TEXT###</div>
    override.if {
        isEmpty.field = bodytext
        negate = 1
    }
}
tt_content.textpic.20.layout.8 {
    value = <div class="csc-textpic csc-textpic-responsive csc-textpic-center csc-textpic-below###CLASSES### has-text clearfix"><div class="col-md-6 pull-right">###IMAGES###</div>###TEXT###</div>
    override >
    override = <div class="csc-textpic csc-textpic-responsive csc-textpic-center csc-textpic-above###CLASSES### clearfix"><div class="col-md-12">###IMAGES###</div>###TEXT###</div>
    override.if {
        isEmpty.field = bodytext
        negate = 1
    }
}

With this Typoscript image is always wrapped with <div class="col-md-12"> and ovveride is taken.

1

1 Answers

1
votes

In this case valuedoes not work and the way goes to override.override.

tt_content.textpic.20.layout.default.override = <div class="csc-textpic csc-textpic-responsive csc-textpic-center csc-textpic-above###CLASSES### has-text clearfix"><div class="col-md-6">###IMAGES###</div>###TEXT###</div>
tt_content.textpic.20.layout.default.override.override.cObject = TEXT
tt_content.textpic.20.layout.default.override.override.cObject.value = <div class="csc-textpic csc-textpic-responsive csc-textpic-center csc-textpic-above###CLASSES### clearfix"><div class="col-md-12">###IMAGES###</div>###TEXT###</div>
tt_content.textpic.20.layout.default.override.override.if.isFalse.field = bodytext

tt_content.textpic.20.layout.8.override = <div class="csc-textpic csc-textpic-responsive csc-textpic-center csc-textpic-below###CLASSES### has-text clearfix"><div class="col-md-6 pull-right">###IMAGES###</div>###TEXT###</div>
tt_content.textpic.20.layout.8.override.override.cObject = TEXT
tt_content.textpic.20.layout.8.override.override.cObject.value = <div class="csc-textpic csc-textpic-responsive csc-textpic-center csc-textpic-above###CLASSES### clearfix"><div class="col-md-12">###IMAGES###</div>###TEXT###</div>
tt_content.textpic.20.layout.8.override.override.if.isFalse.field = bodytext