---
title: "CONTENT"
manual: "TypoScript Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3tsref:cobj-content@main"
source: "ContentObjects/Content/Index.rst"
modified: "2026-09-15T19:22:01+00:00"
---

# 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.

> [!NOTE]
> **See also**
>
> The cObject [RECORDS](https://docs.typo3.org/permalink/t3tsref:cobj-records@main) in contrast is for displaying
> lists of records from a variety of tables without fine graining.

**Table of content**

-   [Properties](https://docs.typo3.org/permalink/t3tsref:properties@main)
-   [Examples](https://docs.typo3.org/permalink/t3tsref:examples@main)
-   [Apply special rendering](https://docs.typo3.org/permalink/t3tsref:apply-special-rendering@main)

## Properties

### if

-   **if**

    -   *Type:* [->if](https://docs.typo3.org/permalink/t3tsref:if@main)

    If "if" returns false, the content is not generated.

### select

-   **select**

    -   *Type:* [select](https://docs.typo3.org/permalink/t3tsref:select@main)

    The SQL-statement, a `SELECT` query, is set here,
    including automatic visibility control.

### table

-   **table**

    -   *Type:* *table name* / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    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 `tt_content`.

### renderObj

-   **renderObj**

    -   *Type:* [Content Objects (cObject)](https://docs.typo3.org/permalink/t3tsref:data-type-cobject@main)
    -   *Default:* `< [table name]`

    The cObject used for rendering the records resulting from the query in
    [select](https://docs.typo3.org/permalink/t3tsref:cobj-content-select@main).

    If `renderObj` is not set explicitly, then
    `< [table name]` is used. So
    in this case the configuration of the according [table](https://docs.typo3.org/permalink/t3tsref:cobj-content-table@main)
    is being copied.

    See the notes on the example below.

### slide

-   **slide**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    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:

    -   **`-1`**

        Slide back up to the site root.

    -   **`1`**

        Only the current level.

    -   **`2`**

        Up from one level back.

    Use `-1` in combination with [collect](https://docs.typo3.org/permalink/t3tsref:cobj-content-slide-collect@main).

### slide.collect

-   **slide.collect**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    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 `-1`
    to collect up to the site root.

### slide.collectFuzzy

-   **slide.collectFuzzy**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    Only useful with [slide.collect](https://docs.typo3.org/permalink/t3tsref:cobj-content-slide-collect@main). If no content
    elements have been found for the specified depth in collect mode, traverse
    further until at least one match has occurred.

### slide.collectReverse

-   **slide.collectReverse**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    Reverse order of elements in collect mode. If set, elements of the current
    page will be at the bottom.

### wrap

-   **wrap**

    -   *Type:* [wrap](https://docs.typo3.org/permalink/t3tsref:data-type-wrap@main) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    Wrap the whole content.

### stdWrap

-   **stdWrap**

    -   *Type:* [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    Apply `stdWrap` functionality.

### cache

-   **cache**

    -   *Type:* [cache](https://docs.typo3.org/permalink/t3tsref:cache@main)

    See [cache function description](https://docs.typo3.org/permalink/t3tsref:cache@main) for details.

## Examples

### CONTENT explained in detail

See PHP class `\TYPO3\CMS\Frontend\ContentObject\ContentContentObject`
for details on code level.

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```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:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
1 = CONTENT

// STEP 1: do nothing if 'if' evaluates to false

1.if {
   # ifclause =
}
```

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
// STEP 2: define parameters

1.table = tt_content           # default='' #stdWrap

1.select {
   pidInList = this
   where = colPos = 1
   orderBy = sorting
}

# renderObj = <TABLEVALUE      # default!
1.renderObj =

# slide = 0                    # default! #stdWrap
1.slide = -1

# slideCollect = 0             # default! #stdWrap
1.slide.collect =

# slideCollectReverse = false  # default! #stdWrap
1.slide.collectReverse =

# slideCollectFuzzy = false    # default! #stdWrap
1.slide.collectFuzzy =
```

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
// STEP 3: find all records

// STEP 4: apply the renderObj to each record and collect
//         the results as string 'totalResult'

// STEP 5: Apply wrap to the 'totalResult'
1.wrap = |                     # default!

// STEP 6: Apply stdWrap to the 'totalResult'
1.stdWrap =                    # default! #stdWrap

// STEP 6: Return 'totalResult'
```

See also: [if](https://docs.typo3.org/permalink/t3tsref:if@main), [select](https://docs.typo3.org/permalink/t3tsref:select@main), [Wrap](https://docs.typo3.org/permalink/t3tsref:data-type-wrap@main), [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main),
[Content Objects (cObject)](https://docs.typo3.org/permalink/t3tsref:data-type-cobject@main)

### Display all tt_content records from this page

Here is an example of the CONTENT object:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
1 = CONTENT
1.table = tt_content
1.select {
   pidInList = this
   orderBy = sorting
   where = {#colPos}=0
}
```

Since in the above example `.renderObj` is not set explicitly, TYPO3
will automatically set `1.renderObj < tt_content`, so that `renderObj`
will reference the TypoScript configuration of `tt_content`. The
according TypoScript configuration will be copied to `renderObj`.

## Apply special rendering

Here is an example of record-rendering objects:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
page = PAGE
page.typeNum = 0

# The CONTENT object executes a database query and loads the content.
page.10 = CONTENT
page.10.table = tt_content
page.10.select {

   # "sorting" is a column from the tt_content table and
   # keeps track of the sorting order, which was specified in
   # the backend.
   orderBy = sorting

   # Only select content from column "0" (the column called
   # "normal") and quote the database identifier (column name)
   # "colPos" (indicated by wrapping with {#})
   where = {#colPos}=0
}

# For every result line from the database query (that means for every content
# element) the renderObj is executed and the internal data array is filled
# with the content. This ensures that we can call the .field property and we
# get the according value.
page.10.renderObj = COA
page.10.renderObj {

   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>
}
```
