Attention

TYPO3 v7 has reached its end-of-life November 30th, 2018 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.

There is no further ELTS support. It is recommended that you upgrade your project and use a supported version of TYPO3.

The various content elements

The setup we just defined is pretty basic and will work only for content elements containing text. But the content elements are varied and we also need to render images, forms, etc.

The type of a content element is stored in the column CType of table "tt_content". We can use this information with a CASE object, which makes it possible to differentiate how the individual content element types are rendered.

page.10.renderObj = CASE
page.10.renderObj {

        # The field CType will be used to differentiate.
        key.field = CType

        # The content type "headline" is stored internally as "header".
        header = TEXT
        header.stdWrap.field = header
        header.stdWrap.wrap = <h1>|</h1>

        # Text is used for the text content element.
        text = COA
        text {

                10 = TEXT
                # The field tt_content.header normally holds the headline.
                10.stdWrap.field = header
                10.stdWrap.wrap = <h1>|</h1>

                20 = TEXT
                # The field tt_content.bodytext holds the content text.
                20.stdWrap.field = bodytext
                20.stdWrap.wrap = <p>|</p>

        }

        # ... other definitions follow here ...
}

For content elements of type "headline" we render the content of the header field wrapped in <h1> tags. For content elements of type "text" we render the headline and the content text.