.. include:: /Includes.rst.txt .. _cobj-content: CONTENT ======= .. note:: * CASE is an object type (= complex data type). * It is a specific :ref:`cObject ` data type. An object with the content type CONTENT is designed to generate content by allowing to finely select records and have them rendered. What records are visible is controlled by `start` and `end` fields and more standard fields automatically. The internal value `SYS_LASTCHANGED` is raised to the maximum timestamp value of the respective records. .. seealso:: The cObject :ref:`RECORDS ` in contrast is for displaying lists of records from a variety of tables without fine graining. Comprehensive example --------------------- See PHP source code for :php:`TypoScriptFrontendController`. Preamble:: # Note: TypoScript (TS) is just another way to define an array of settings which # is later on INTERPRETED by TYPO3. TypoScript can be written in ANY order # as long as it leads to the same array. Actual execution order is TOTALLY # INDEPENDENT of TypoScript code order. # # The order of TS in this example however tries to reflect execution order. # The denoted steps are taking place in that order at execution time. Condensed form:: 1 = CONTENT 1 { if { } table = tt_content select { pidInList = this orderBy = sorting } renderObj = < tt_content slide = 0 slide { collect = 0 collectReverse = 0 collectFuzzy = 0 } wrap = stdWrap = } Expanded form:: 1 = CONTENT // STEP 1: do nothing if 'if' evaluates to false 1.if { # ifclause = } :: // STEP 2: define parameters 1.table = tt_content # default='' #stdWrap 1.select { pidInList = this orderBy = sorting } # renderObj = checkPid_badDoktypeList`. .. ###### END~OF~TABLE ###### .. _cobj-content-wrap: wrap ---- .. ### BEGIN~OF~TABLE ### .. container:: table-row Property wrap Data type :ref:`wrap ` /:ref:`stdWrap` Description Wrap the whole content. .. ###### END~OF~TABLE ###### .. _cobj-content-stdWrap: stdWrap ------- .. ### BEGIN~OF~TABLE ### .. container:: table-row Property stdWrap Data type :ref:`stdwrap` Description Apply `stdWrap` functionality. .. ###### END~OF~TABLE ###### .. _cobj-content-examples: CONTENT object example 1 ------------------------ Here is an example of the CONTENT object:: 1 = CONTENT 1.table = tt_content 1.select { pidInList = this orderBy = sorting } Since in the above example .renderObj is not set explicitly, TYPO3 will automatically set :typoscript:`1.renderObj < tt_content`, so that `renderObj` will reference the TypoScript configuration of `tt_content`. The according TypoScript configuration will be copied to `renderObj`. CONTENT object example 2 ------------------------ Here is an example of record-rendering objects:: // Configuration for records with the "field" type value // (often "CType") set to "header" tt_content.header.default { 10 = TEXT 10.stdWrap.field = header # ... } // Configuration for records with the "field" type value // (often "CType") set to "bullets" // If field "layout" is set to "1" or "2", a special configuration is used, // else defaults are being used. tt_content.bullets.subTypeField = layout tt_content.bullets.default { # ... } tt_content.bullets.1 { # ... } tt_content.bullets.2 { # ... } // This is what happens if the "field" type value does not match any of the above tt_content.default.default { # ... }