TEXT

A content object of the type "TEXT" can be used to output static text or HTML.

stdWrap properties are available under the property "value" and on the very rootlevel of the object.

Properties

value

value
Type
string / stdWrap

Text, which you want to output.

stdWrap

stdWrap
Type
stdWrap

stdWrap properties are available on the very root level of the object. This is non-standard! You should use these stdWrap properties consistently to those of the other cObjects by accessing them through the property "stdWrap".

cache

cache
Type
cache

See cache function description for details.

Examples

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value = This is a text in uppercase
10.stdWrap.case = upper
Copied!

The above example uses the stdWrap property case. It returns "THIS IS A TEXT IN UPPERCASE".

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value.field = title
10.stdWrap.wrap = <strong>|</strong>
Copied!

The above example gets the header of the current page (which is stored in the database field title). The header is then wrapped in <strong> tags, before it is returned.

Now let us have a look at an extract from a more complex example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = TEXT
10.value.field = bodytext
10.stdWrap.parseFunc < lib.parseFunc_RTE
10.stdWrap.dataWrap = <div>|</div>
Copied!

The above example returns the content, which was found in the field bodytext of the current record from $cObj->data-array. Here that shall be the current record from the database table tt_content. This is useful inside COA objects.

Here is the same example in its context:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = CONTENT
10 {
  table = tt_content
  select {
    where.dataWrap = irre_parentid  = {field:uid}
    begin = 0
  }

  renderObj = COA
  renderObj {
    stdWrap.if.isTrue.data = field:bodytext
    10 = TEXT
    10.value.field = bodytext
    10.stdWrap.parseFunc < lib.parseFunc_RTE
    10.stdWrap.dataWrap = <div>|</div>
   }
}
Copied!

Here we use the cObject CONTENT to return all content elements (records from the database table "tt_content"), which are on the current page. (These content elements have the corresponding value in irre_parentid.) They are rendered using a COA cObject, which only processes them, if there is content in the field bodytext.

The resulting records are each rendered using a TEXT object:

The TEXT object returns the content of the field bodytext of the according tt_content record. (Note that the property "field" in this context gets content from the table tt_content and not - as in the example above - from pages. See the description for the data type getText/field!) The resulting content is then parsed with parseFunc and finally wrapped in <div> tags before it is returned.