Trailerbild
Certified TYPO3 Integrator
Meine aktuelle Buchempfehlung:

Links

Website meiner Frau Martina Thiele:
externer Link folgtwww.tagesmutter- luebbecke.de

Zur Webseite vom Ferienhaus auf Usedom von meinem Bruder Christian Thiele:
externer Link folgtwww.am-jungfernberg.de

Sie sind hier: Startseite » TYPO3 » TSref » Daten Typen

Daten Typen

Mit der Definition der Datentypen können Sie sehen, welche Werte sie bei einer bestimmten Objekteigenschaft benutzen können. So hat z.B. das cObject TEXT  die Eigenschaft "value". Hier in der Datentypen-Referenz können Sie dann nachschlagen, ob jetzt z.B. eine Zahl, ein Text, ein Ja/Nein oder vielleicht ein Dateipfad angegeben werden muss, damit dieser value eine sinnvolle Ausgabe im Frontend produziert.

Die Datentype-Referenztabelle:

Definition und Beschreibung der Datentypen

Datentyp

Beispiel

Kommentar

Standard

<tag>

<body class="main">

 

 

align

right

right / left /center
Entscheidet über die Ausrichtung, typischerweise in HTML-Tags

left

current

boolisch

Setzt den Inhalt auf den aktuellen Wert. (Siehe auch »split)

 

str / string / value

 

Text-String

 

boolisch

1

Boolischer Wert (also Wahr oder Falsch)
Alle nicht-leeren Strings mit einem Wert ungleich 0 sind "wahr"

 

list

Wert1,Wert2,Wert3

Liste von mehreren komma-separierten Werten

 

wrap

Mit diesem Wrap wird der Wert "Warnung!" mit einem <span>-Tag umschlossen:
page.10 = TEXT
page.10.value = Warnung!
page.10.wrap = <span class="important">|</span>

Der Text vor dem "|" Pipe-Symbol wird vor diesem gesetzt, das Pipe-Symbol wird mit dem Orginaltext ausgetauscht und der Text hinter dem Pipe-Symbol wird nach dem "|" gesetzt. Dabei wird der Text durch eine trim-Funktion geleitet. Möchte man dies vermeiden, dann hilft die Funktion noTrimWrap weiter.

 

getText

get content from the $cObj->data-array[header]:
= field : header

get content from the $cObj->parameters-array[color]:
= parameters : color

get content from the $GLOBALS["TSFE"]->register[color]:
= register : color

get the title of the page on the first level of the rootline:
= leveltitle : 1

get the title of the page on the level right below the current page AND if that is not present, walt to the bottom of the rootline until there's a title:
= leveltitle : -2 , slide

get the id of the root-page of the website (level zero)
= leveluid : 0

Gets the value of the user defined field “user_myExtField” in the root line (requires additional config in TYPO3_CONF_VARS to include field!)
= levelfield : -1 , user_myExtField , slide

get the env var HTTP_REFERER:
= getenv : HTTP_REFERER

get the env variable $HTTP_COOKIE_VARS[some_cookie]:
= global : HTTP_COOKIE_VARS | some_cookie

get the current time formatted dd-mm-yy:
= date : d-m-y

get the current page-title:
= page : title

get the current value:
= current : 1

get input value from query string, (&stuff=)
= GPvar : stuff

get input value from query string, (&stuff[key]=)
= GPvar : stuff | key

get the current id
= TSFE : id

get the value of the header of record with uid 234 from table tt_content:
= DB : tt_content:234:header

Gets the title of the page right before the start of the current website:
= fullRootLine : -1, title

Returns localized label for logout button
= LLL:EXT:css_styled_content/pi1/locallang.x:login.logout

Outputs the current root-line visually in HTML:
= debug : rootLine

Gets path to file relative file to siteroot possibly placed in an extension:
path:EXT:ie7/js/ie7-standard.js

This returns a value from somewhere in PHP-array, defined by the type. The syntax is "type : pointer"

field : [fieldname from the current $cObj->data-array in the cObj.]

As default the $cObj->data-array is $GLOBALS["TSFE"]->page (record of the current page!)

In TMENU: $cObj->data is set to the page-record for each menuitem.

In CONTENT/RECORDS $cObj->data is set to the actual record

In GIFBUILDER $cObj->data is set to the data GIFBUILDER is supplied with.

parameters : [fieldname from the current $cObj->parameters-array in the cObj.]

See ->parseFunc!

register : [fieldname from the $GLOBALS["TSFE"]->register]

See cObject "LOAD_REGISTER"

leveltitle, leveluid, levelmedia: [levelTitle, uid or media in rootLine, 0- , negative = from behind, “ , slide” parameter forces a walk to the bottom of the rootline until there's a “true” value to return. Useful with levelmedia.]

levelfield: Like “leveltitle” et al. but where the second parameter is the rootLine field you want to fetch. Syntax: [pointer, integer], [fieldname], [“slide”]

global : [GLOBAL-var, split with | if you want to get from an array! DEPRECATED, use GPvar, TSFE or getenv]

date : [date-conf]

page : [current page record]

current : 1 (gets 'current' value)

level : 1 (gets the rootline level of the current page)

GPvar: Value from GET or POST method. Use this instead of global

TSFE: Value from TSFE global main object

getenv: Value from environment vars

getIndpEnv: Value from t3lib_div::getIndpEnv()

DB: Value from database, syntax is [tablename] : [uid] : [field]. Any record from a table in TCA can be selected here. Only marked-deleted records does not return a value here.

fullRootLine : This gets the title “1. page before” in a page tree like the one below provided we are are the page “Here you are!” (or “Site root”) and this TypoScript is in the template with root at “Site root”. Red numbers indicate what values of keynumber would point to:

- Page tree root -2

|- 1. page before -1

|- Site root (root template here!) 0

|- Here you are! 1

LLL: Reference to a locallang (php or xml) label. Reference consists of [fileref]:[labelkey]

path: path to a file, possibly placed in an extension, returns empty if the file doesn't exist.

cObj: [internal variable from list: “parentRecordNumber”]: For CONTENT and RECORDS cObjects that are returned

by a select query, this returns the row number (1,2,3,...) of the current cObject record.

debug: Returns HTML formated content of PHP variable defined by keyword. Available keys are “rootLine”, “fullRootLine”, “data”

--------------------

Getting array/object elements.

You can fetch the value of an array/object by splitting it with a pipe “|”.Example: TSFE:fe_user|user|username

Getting more values.

By separating the value of getText with "//" (double slash) you let getText fetch the first value. If it appears empty ("" or zero) the next value is fetched and so on. Example:

= field:header // field:title // field:uid

This gets "title" if "header" is empty. If "title" is also empty it gets field "uid"

fullRootLine :

Getting a value from the rootline (TSFE->rootLine) going all the way to the root of the page tree.

[keynumber, fieldname, “slide”]

Keynumber is relative to the current site root, so negative numbers refer to subsequent levels below the site root. Fieldname is the name of the datafield to get. For “slide”, see levelmedia type above.