TYPO3 wrap div to content element by selecting Content Element Layout

Here is how we can wrap text content element by custom div class.

temp.text < tt_content.text
tt_content.text = CASE
tt_content.text {
    key.field = layout

    0 < temp.text
    0.stdWrap.innerWrap = <div class="layout-one">|</div>

    1 < temp.text
    1.stdWrap.innerWrap = <div class="layout-two">|</div>

    2 < temp.text
    2.stdWrap.innerWrap = <div class="layout-three">|</div>
}

 

Similarly we can wrap image content element by

temp.image < tt_content.image