.. include:: /Includes.rst.txt .. index:: Content objects; CONTENT CONTENT Content objects; SQL Content objects; Database .. _cobj-content: ======= CONTENT ======= 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. .. contents:: :local: .. _cobj-content-properties: Properties ========== .. _cobj-content-select: select ------ .. confval:: select :name: content-select :type: :ref:`select` The SQL-statement, a :sql:`SELECT` query, is set here, including automatic visibility control. .. _cobj-content-table: table ----- .. confval:: table :name: content-table :type: *table name* / :ref:`stdwrap` The table, the content should come from. Any table can be used; a check for a table prefix is not done. In standard configuration this will be :sql:`tt_content`. .. _cobj-content-renderObj: renderObj --------- .. confval:: renderObj :name: content-renderObj :type: :ref:`data-type-cObject` :Default: :typoscript:`< [table name]` The cObject used for rendering the records resulting from the query in :ref:`cobj-content-select`. If :typoscript:`renderObj` is not set explicitly, then :typoscript:`< [table name]` is used. So in this case the configuration of the according :ref:`cobj-content-table` is being copied. See the notes on the example below. .. _cobj-content-slide: slide ----- .. confval:: slide :name: content-slide :type: :ref:`data-type-integer` / :ref:`stdWrap` If set and no content element is found by the select command, the rootLine will be traversed back until some content is found. Possible values are: :typoscript:`-1` Slide back up to the site root. :typoscript:`1` Only the current level. :typoscript:`2` Up from one level back. Use :typoscript:`-1` in combination with :ref:`collect `. .. _cobj-content-slide-collect: slide.collect ~~~~~~~~~~~~~ .. confval:: slide.collect :name: content-slide-collect :type: :ref:`data-type-integer` / :ref:`stdWrap` If set, all content elements found on the current and parent pages will be collected. Otherwise, the sliding would stop after the first hit. Set this value to the amount of levels to collect on, or use :typoscript:`-1` to collect up to the site root. .. _cobj-content-slide-collectFuzzy: slide.collectFuzzy ~~~~~~~~~~~~~~~~~~ .. confval:: slide.collectFuzzy :name: content-slide-collectFuzzy :type: :ref:`data-type-boolean` / :ref:`stdWrap` Only useful with :ref:`slide.collect `. If no content elements have been found for the specified depth in collect mode, traverse further until at least one match has occurred. .. _cobj-content-slide-collectReverse: slide.collectReverse ~~~~~~~~~~~~~~~~~~~~ .. confval:: slide.collectReverse :name: content-slide-collectReverse :type: :ref:`data-type-boolean` / :ref:`stdWrap` Reverse order of elements in collect mode. If set, elements of the current page will be at the bottom. .. _cobj-content-wrap: wrap ---- .. confval:: wrap :name: content-wrap :type: :ref:`wrap ` / :ref:`stdWrap` Wrap the whole content. .. _cobj-content-stdWrap: stdWrap ------- .. confval:: stdWrap :name: content-stdWrap :type: :ref:`stdWrap` Apply `stdWrap` functionality. .. _cobj-content-cache: cache ----- .. confval:: cache :name: content-cache :type: :ref:`cache ` See :ref:`cache function description ` for details. .. _cobj-content-examples: Examples ======== .. _cobj-content-example-detail: CONTENT explained in detail --------------------------- See PHP class :php:`\TYPO3\CMS\Frontend\ContentObject\ContentContentObject` for details on code level. .. code-block:: typoscript :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript 1 = CONTENT 1 { if { } table = tt_content select { pidInList = this where = colPos = 1 orderBy = sorting } renderObj = < tt_content slide = 0 slide { collect = 0 collectReverse = 0 collectFuzzy = 0 } wrap = stdWrap = } Expanded form: .. code-block:: typoscript :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript 1 = CONTENT // STEP 1: do nothing if 'if' evaluates to false 1.if { # ifclause = } .. code-block:: typoscript :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript // STEP 2: define parameters 1.table = tt_content # default='' #stdWrap 1.select { pidInList = this where = colPos = 1 orderBy = sorting } # renderObj = | 20 = TEXT # The field tt_content.bodytext holds the content text. 20.stdWrap.field = bodytext 20.stdWrap.wrap =

|

}