Core Documentation

Here you will find the new official reference manuals. These documents are related to the core of TYPO3 and address the built in functionality of TYPO3. They are designed to provide you with in-depth information.

Old Core Documentation


1.5. Functions

stdWrap

This function is often added as properties to values in TypoScript.

Example with the content-object, "HTML":

10 = HTML
10.value = some text
10.value.case = upper

Here the content of the object "10" is uppercased before it's returned.

stdWrap properties are executed in the order they appear in the table below. If you want to study this further please refer to typo3/sysext/cms/tslib/class.tslib_content.php, function stdWrap().

Content-supplying properties of stdWrap:

The properties in this table is parsed in the listed order. The properties "data", "field", "current", "cObject" (in that order!) are special as they are used to import content from variables or arrays. The above example could be rewritten to this:

10 = HTML
10.value = some text
10.value.case = upper
10.value.field = header

Now the line "10.value = some text" is obsolete, because the whole value is "imported" from the field called "header" from the $cObj->data-array.

Property:

Data type:

Description:

Default:

Get data:

   

setContentToCurrent

boolean

Sets the current value to the incoming content of the function.

setCurrent

string /stdWrap

Sets the "current"-value. This is normally set from some outside routine, so be careful with this. But it might be handy to do this

lang

Array of language keys

This is used to define optional language specific values.

If the global language key set by the ->config property .language is found in this array, then this value is used instead of the default input value to stdWrap.

Example:

config.language = de

page.10 = TEXT

page.10.value = I am a Berliner!

page.10.lang.de = Ich bin ein Berliner!

Output will be “Ich bin...” instead of “I am...”

data

getText

field

fieldname

Sets the content to the value $cObj->data[field]

Example: Set content to the value of field "title": ".field = title"

$cObj->data changes. See the description for the data type "getText"/field!

Note: You can also divide fieldnames by “//”. Say, you set “nav_title // title” as the value, then the content from the field nav_title will be returned unless it is a blank string, in which case the title-field's value is returned.

current

boolean

Sets the content to the "current"-value (see ->split)

cObject

cObject

Loads content from a content-object

numRows

->numRows

Returns the number of rows resulting from the select

filelist

dir /stdWrap

Reads a directory and returns a list of files.

The value is exploded by "|" into parameters:

1: The path

2: comma-list of allowed extensions (no spaces between); if empty all extensions goes.

3: sorting: name, size, ext, date, mdate (modification date)

4: reverse: Set to "r" if you want a reversed sorting

5: fullpath_flag: If set, the filelist is returned with complete paths, and not just the filename

preUserFunc

function-name

Calling a PHP-function or method in a class, passing the current content to the function as first parameter and any properties as second parameter.

See .postUserFunc

Override / Conditions:

   

override

string /stdWrap

if "override" returns something else than "" or zero (trimmed), the content is loaded with this!

preIfEmptyListNum

(as "listNum" below)

(as "listNum" below)

ifEmpty

string /stdWrap

if the content is empty (trimmed) at this point, the content is loaded with "ifEmpty". Zeros are treated as empty values!

ifBlank

string /stdWrap

Same as "ifEmpty" but the check is done using strlen().

listNum

int

+calc

+"last"

Explodes the content with "," (comma) and the content is set to the item[value].

Special keyword: "last" is set to the last element of the array!

.splitChar (string):

Defines the string used to explode the value. If splitChar is an integer, the character with that number is used (eg. "10" to split lines...).

Default: “," (comma)

.stdWrap (stdWrap properties):

stdWrap properties of the listNum...

Examples:

We have a value of "item 1, item 2, item 3, item 4":

This would return "item 3":

.listNum = last - 1

trim

PHP-function trim(); Removes whitespace around value

stdWrap

->stdWrap

Recursive call to stdWrap function

required

boolean

This flag requires the content to be set to some value after any content-import and treatment that might have happend now (data, field, current, listNum, trim). Zero's is NOT regarded as empty! Use "if" instead!

If the content i empty, "" is returned immediately.

if

->if

If the if-object returns false, stdWrap returns "" immediately

fieldRequired

fieldname

value in this field MUST be set

Parse data:

   

csConv

string

Convert the charset of the string from the charset given as value to the current rendering charset of the frontend (renderCharset).

parseFunc

object path reference / ->parseFunc

Processing instructions for the content.

Notice: If you enter a string as value this will be taken as a reference to an object path globally in the TypoScript object tree. This will be the basis configuration for parseFunc merged with any properties you add here. It works exactly like references does for content elements.

Example:

parseFunc = < lib.parseFunc_RTE

parseFunc.tags.myTag = TEXT

parseFunc.tags.myTag.value = This will be inserted when &lt;myTag&gt; is found!

HTMLparser

boolean / ->HTMLparser

This object allows you to parse the HTML-content and make all kinds of advanced filterings on the content.

Value must be set and properties are those of ->HTMLparser.

(See adminguide for ->HTMLparser options)

split

->split

prioriCalc

boolean

Calculation of the value using operators -+*/%^ plus respects priority to + and - operators and parenthesis levels ().

. (period) is decimal delimiter.

Returns a doublevalue.

If .prioriCalc is set to “intval” an integer is returned.

There is no errorchecking and division by zero or other invalid values may generate strange results. Also you use a proper syntax because future modifications to the function used may allow for more operators and features.

Examples:

100%7 = 2

-5*-4 = 20

+6^2 = 36

6 ^(1+1) = 36

-5*-4+6^2-100%7  = 54

-5 * (-4+6) ^ 2 - 100%7 = 98

-5 * ((-4+6) ^ 2) - 100%7 = -22

char

int

Content is set to the chr(value).

PHP: $content=chr(intval($conf["char"]);

intval

boolean

PHP function intval(); Returns an integer.

PHP: $content=intval($content);

date

date-conf

The content should be data-type "UNIX-time". Returns the content formatted as a date.

$content=Date($conf["date"], $content);

Example where a timestamp is imported:

.value.field = tstamp

.value.date =

strftime

strftime-conf

Exactly like "date" above. See the PHP-manual (strftime) for the codes, or datatype "strftime-conf".

This formatting is useful if the locale is set in advance in the CONFIG-object. See this.

Properties:

.charset  : Can be set to the charset of the output string if you need to convert it to renderCharset. Default is to take the intelligently guessed charset from t3lib_cs.

age

boolean or string

If enabled with a "1" (number, integer) the content is seen as a date (UNIX-time) and the difference from present time and the content-time is returned as one of these four variations:

"xx min" or "xx hrs" or "xx days" or "xx yrs"

The limits between which layout is used are 60 minutes, 24 hours, 365 days,

NOTE:

If you set this property with a non-integer, it's used to format the four units. This is the default value:

" min| hrs| days| yrs"

Set another string if you want to change the units. You may include the "-signs. They are removed anyway.

case

case

Converts case

Uses "renderCharset" for the operation.

bytes

boolean

Will format the input (an integer) as bytes: bytes, kb, mb

If you add a value for the property “labels” you can alter the default suffixes. Labels for bytes, kilo, mega and giga are separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G" (which is the default value)

Thus:

bytes.labels = “ | K| M| G”

substring

[p1],  [p2]

Returns the substring with [p1] and [p2] send as the 2nd and 3rd parameter to the PHP substring function.

Uses "renderCharset" for the operation.

removeBadHTML

boolean

Removes "bad" HTML code based on a pattern that filters away HTML that is considered dangerous for XSS bugs.

cropHTML

Crops the content to a certain length. In contrast to stdWrap.crop it respects HTML tags. It does not crop inside tags and closes open tags. Entities (like ">") are counted as one char. See stdWrap.crop below for a syntax description and examples.

Note that stdWrap.crop should not be used if stdWrap.cropHTML is already used.

stripHtml

boolean

Strips all html-tags.

crop

Crops the content to a certain length

Syntax: +/- (chars) = from left / from right | [string] | [boolean: keep whole words]

Examples:  

20 | ...    => max 20 characters. If more, the value will be truncated to first 20 chars and prepended with "..."

-20 | ... => max 20 characters. If more, the value will be truncated to last 20 chars and appended with "..."

20 | ... | 1 => max 20 characters. If more, the value will be truncated to last 20 chars and appended with "...". If the division is in the middle of a word, the remains of that word is removed.

Uses "renderCharset" for the operation.

rawUrlEncode

boolean

Passes the content through rawurlencode()-PHP-function

htmlSpecialChars

boolean

Passes the content through htmlspecialchars()-PHP-function

Additional property “.preserveEntities” will preserve entities so only non-entity chars are affected.

doubleBrTag

string

All double-line-breaks are substituted with this value.

br

boolean

PHP function nl2br(); Converts linebreaks to <br />-tags

brTag

string

All ASCII-codes of "10" (CR) is substituted with value

encapsLines

->encapsLines

Lets you split the content by chr(10) and proces each line independently. Used to format content made with the RTE.

keywords

boolean

splits the content by characters "," ";" and chr(10) (return), trims each value and returns a comma-separated list of the values.

innerWrap

wrap /stdWrap

Wraps the content

innerWrap2

wrap /stdWrap

same as .innerWrap (but watch the order in which they are executed)

fontTag

wrap

addParams

->addParams

Lets you add tag-parameters to the content if the content is a tag!

textStyle

->textStyle

Wraps content in font-tags

tableStyle

->tableStyle

Wraps content with table-tags

filelink

->filelink

Used to make lists of links to files.

preCObject

cObject

cObject prepended the content

postCObject

cObject

cObject appended the content

wrapAlign

align /stdWrap

Wraps content with <div style=text-align:[value];”> | </div> if align is set

typolink

->typolink

Wraps the content with a link-tag

TCAselectItem.

Array of properties

Resolves a comma seperated list of values into the TCA item representation.

.table (string): The Table to look up

.field (string): The field to resolve

.delimiter (string): Delimiter for concatenating multiple elements.

Notice: Currently this works only with TCA fields of type “select” which are not database relations.

spaceBefore

int /stdWrap

Pixels space before. Done with a clear-gif; <img ...><BR>

spaceAfter

int /stdWrap

Pixels space after. Done with a clear-gif; <img ...><BR>

space

space /stdWrap

[spaceBefore]   |   [spaceAfter]

Additional property:

.useDiv = 1

If set, a clear gif is not used but rather a <div> tag with a style-attribute setting the height. (Affects spaceBefore and spaceAfter as well).

wrap

wrap /+.splitChar

.splitChar defines an alternative splitting character (default is “|” - the vertical line)

noTrimWrap

"special" wrap

This wraps the content with the values val1 and val2 in the example below - including surrounding whitespace! - without trimming the values. Note that this kind of wrap requires a "|"  character to begin and end the wrap.

Example:

| val1 | val2 |

wrap2

wrap /+.splitChar

same as .wrap (but watch the order in which they are executed)

dataWrap

The content is parsed for sections of {...} and the content of {...} is of the type getText and substituted with the result of getText.

Example:

This will produce a tag around the content with an attribute that contains the number of the current page:

<div id="{tsfe : id}"> | </div>

prepend

cObject

cObject prepended to content (before)

append

cObject

cObject appended to content (after)

wrap3

wrap /+.splitChar

same as .wrap (but watch the order in which they are executed)

outerWrap

wrap /stdWrap

Wraps the complete content

insertData

boolean

If set, then the content string is parsed like .dataWrap above.

Example:

Displays the page title:

10 = TEXT

10.value = This is the page title: {page:title}

10.insertData = 1

offsetWrap

x,y

This wraps the input in a table with columns to the left and top that offsets the content by the values of x,y. Based on the cObject OTABLE.

.tableParams / .tdParams /stdWrap

- used to manipulate tableParams/tdParams (default width=99%)  of the offset. Default: See OTABLE.

.stdWrap

- stdWrap properties wrapping the offsetWrap'ed output

postUserFunc

function-name

Calling a PHP-function or method in a class, passing the current content to the function as first parameter and any properties as second parameter. Please see the description of the cObject USER for in-depth information.

Example:

You can paste this example directly into a new template record.

page = PAGE

page.typeNum=0

includeLibs.something = media/scripts/example_callfunction.php

page.10 = TEXT

page.10 {

  value = Hello World

  postUserFunc = user_reverseString

  postUserFunc.uppercase = 1

}

page.20 = TEXT

page.20 {

  value = Hello World

  postUserFunc = user_various->reverseString

  postUserFunc.uppercase = 1

  postUserFunc.typolink = 11

}

postUserFuncInt

function-name

Calling a PHP-function or method in a class, passing the current content to the function as first parameter and any properties as second parameter. The result will be rendered non-cached, outside the main page-rendering. Please see the description of the cObject USER_INT and PHP_SCRIPT_INT for in-depth information.

Supplied by Jens Ellerbrock

prefixComment

string

Prefixes content with a HTML comment with the second part of input string (divided by "|") where first part is an integer telling how many trailing tabs to put before the comment on a new line.

The content is parsed through insertData.

Example:

prefixComment = 2 | CONTENT ELEMENT, uid:{field:uid}/{field:CType}

Will indent the comment with 1 tab (and the next line with 2+1 tabs)

(Added in TYPO3 >3.6.0RC1)

editIcons

string

If not empty, then insert an icon linking to the typo3/alt_doc.php with some parameters to build and backend user edit form for certain fields.

The value of this property is a list of fields from a table to edit. It's assumed that the current record of the cObj is the record to be edited.

Syntax: optional tablename : comma list of fieldnames[list of pallette-field names separated by | ]

.beforeLastTag (1,0,-1): If set (1), the icon will be inserted before the last HTML tag in the content. If -1 the icon will be prepended to the content. If zero (0) the icon is appended in the end of the content.

.styleAttribute (string): Adds a style-attribute to the icon image with this value. For instance you can set “position:absolute” if you want a non-destructive insertion of the icon. Notice: For general styling all edit icons has the class “frontEndEditIcons” which can be addressed from the stylesheet of the site.

.iconTitle (string): The title attribute of the image tag.

.iconImg (HTML): Alternative HTML code instead of the default icon shown. Can be used to set another icon for editing (for instance a red dot or otherwise... :-)

Example:

This will insert an edit icon which links to a form where the header and bodytext fields are displayed and made available for editing (provided the user has access!).

editIcons = tt_content : header, bodytext

Or this line that puts the header_align and date field into a “palette” which means they are displayed on a single line below the header field. This saves some space.

editIcons = header[header_align|date], bodytext

editPanel

boolean / editPanel

See cObject EDITPANEL.

debug

boolean

Prints content with HTMLSpecialChars() and <PRE></PRE>: Usefull for debugging which value stdWrap actually ends up with, if you're constructing a website with TypoScript.

Should be used under construction only.

debugFunc

boolean

Prints the content directly to browser with the debug() function.

Should be used under construction only.

Set to value “2” the content will be printed in a table - looks nicer.

debugData

boolean

Prints the current data-array, $cObj->data, directly to browser. This is where ".field" gets data from.

Should be used under construction only.

[tsref:->stdWrap]

imgResource

imgResource is properties that is used with the data type imgResource.

Example:

This scales the image toplogo.gif to the width of 200 pixels

file = toplogo.gif
file.width = 200

Property:

Data type:

Description:

Default:

ext

imageExtension /stdWrap

web

width

pixels /stdWrap

If both the width and the heigth are set and one of the numbers is appended by an "m", the proportions will be preserved and thus width/height are treated as maximum dimensions for the image. The image will be scaled to fit into width/height rectangle.

If both the width and the heigth are set and at least one of the numbers is appended by a "c", cropscaling will be enabled. This means that the proportions will be preserved and the image will be scaled to fit around a rectangle with width/height dimensions. Then, a centered portion from inside of the image (size defined by width/height) will be cut out.

The "c" can have a percentage value (-100 ... +100) after it, which defines how much the cropping will be moved off the center to the border.

Notice that you can only use “m” or “c” at the same time!

Examples:

This crops 120x80px from the center of the scaled image:

.width = 120c.height = 80c

This crops 100x100px; from landscape-images at the left and portrait-images centered:

.width = 100c-100.height = 100c

This crops 100x100px; from landscape-images a bit right of the center and portrait-images a bit upper than centered:

.width = 100c+30

.height = 100c-25

height

pixels /stdWrap

see “.width”

params

string

ImageMagick command-line:

fx. "-rotate 90" or "-negate"

sample

boolean

If set, -sample is used to scale images instead of -geometry. Sample does not use antialiasing and is therefore much faster.

alternativeTempPath

string

Enter an alternative path to use for temp images. Must be found in the list in TYPO3_CONF_VARS[FE][allowedTempPaths]

frame

int

Chooses which frame in an gif-animation or pdf-file.

"" = first frame (zero)

import

path /stdWrap

value should be set to the path of the file

with stdWrap you get the filename from the data-array

Example:

This returns the first image in the field "image" from the data-array:

.import = uploads/pics/

.import.field = image

.import.listNum = 0

maxW

pixels /stdWrap

Max width

maxH

pixels /stdWrap

Max height

minW

pixels /stdWrap

Min width (overrules maxW/maxH)

minH

pixels /stdWrap

Min height (overrules maxW/maxH)

stripProfile

boolean

If set, IM-command will use a stripProfile-command which shrinks the generated thumbnails. See Install Tool for options and details.

If im_useStripProfileByDefault is set in the install tool, you can deactivate it by setting stripProfile=0.

Example:

10 = IMAGE

10.file = fileadmin/images/image1.jpg

10.file.stripProfile = 1

Masking:

(Black hides, white shows)

   

m.mask

imgResource

The mask by which the image is masked onto "m.bgImg". Both "m.mask" and "m.bgImg" is scaled to fit the size of the imgResource image!

NOTE: Both "m.mask" and "m.bgImg" must be valid images.

m.bgImg

imgResource

NOTE: Both "m.mask" and "m.bgImg" must be valid images.

m.bottomImg

imgResource

An image masked by "m.bottomImg_mask" onto "m.bgImg" before the imgResources is masked by "m.mask".

Both "m.bottomImg" and "m.bottomImg_mask" is scaled to fit the size of the imgResource image!

This is most often used to create an underlay for the imgResource.

NOTE: Both "m.bottomImg" and "m.bottomImg_mask" must be valid images.

m.bottomImg_mask

imgResource

(optional)

NOTE: Both "m.bottomImg" and "m.bottomImg_mask" must be valid images.

[tsref:->imgResource]

imageLinkWrap

This object wraps the input (an image) with a link to the script "showpic.php" with parameters that define such things as the size of the image, the background color of the new window and so on.

An md5-hash of the parameters is generated. The hash is also generated in "showpic.php" and the hashes MUST match in order for the image to be shown. This is a safety feature in order to prevent users from changing the parameters in the url themselves.

PHP-function: $cObj->imageLinkWrap()

Property:

Data type:

Description:

Default:

file

stdWrap

Override the path of the image which is displayed

width

int (1-1000)

If you add "m" to either the width or height, the image will be held in proportions and width/height works as max-dimensions

height

int (1-1000)

see ".width"

effects

see GIFBUILDER / effects. (from stdgraphics-library)

Example:

gamma=1,3 | sharpen=80 | solarize=70

sample

boolean

If set, -sample is used to scale images instead of -geometry. Sample does not use antialiasing and is therefore much faster.

alternativeTempPath

Enter an alternative path to use for temp images. Must be found in the list in TYPO3_CONF_VARS[FE][allowedTempPaths]

title

string

page title of the new window (HTML)

bodyTag

<tag>

Body tag of the new window

wrap

wrap

Wrap of the image, which is output between the body-tags

target

<A>-data:target

NOTE: Only if ".JSwindow" is set

JSwindow

boolean

The image will be opened in a new window which is fitted to the dimensions of the image!

JSwindow.expand

x,y

x and y is added to the window dimensions.

JSwindow.newWindow

boolean

Each picture will open in a new window!

JSwindow.altUrl

string /stdWrap

If this returns anything, the URL shown in the JS-window is NOT showpic.php but the url given here!

JSwindow.altUrl_noDefaultParams

boolean

If this is set, the image parameters are not appended to the altUrl

automatically. This is useful if you want to create them with a userfunction

instead.

typolink

->typolink

NOTE: This overrides the imageLinkWrap if it returns anything!!

stdWrap

->stdWrap

Enable stdWrap for the image

enable

boolean /stdWrap

The image is linked ONLY if this is true!!

0

[tsref:->imageLinkWrap]

Example:

    1.imageLinkWrap = 1
    1.imageLinkWrap {
      enable = 1
      bodyTag = <BODY bgColor=black>
      wrap = <A href="javascript:close();"> | </A>
      width = 800m
      height = 600
      JSwindow = 1
      JSwindow.newWindow = 1
      JSwindow.expand = 17,20
    }

numRows

This object return the number of rows

Property:

Data type:

Description:

Default:

table

tablename

select

->select

Select query for the operation.

The property “selectFields” is overridden internally with “count(*)”.

[tsref:->numRows]

select

This object generates an SQL-select statement needed to select records from the database.

Some records are hidden or timed by start and end-times. This is automatically added to the SQL-select by looking in the tables.php-array (enablefields)

Also, if the "pidInList" feature is used, any page in the pid-list that is not visible for the user of the website IS REMOVED from the pidlist. Thereby no records from hidden, timed or access-protected pages are selected! Nor records from recyclers.

Property:

Data type:

Description:

Default:

uidInList

list of page_id

pidInList

list of page_id /stdWrap

this

recursive

int

Recursive levels for the pidInList

0

orderBy

SQL-orderBy

Without "order by"! Eg. "sorting, title"

groupBy

SQL-groupBy

Without "group by"! Eg. "CType"

max

int

+calc

+"total"

Max records

Special keyword: "total" is substituted with count(*)

begin

int

+calc

+"total"

Begin with record number value

Special keyword: "total" is substituted with count(*)

where

SQL-where

Without "where"!, Eg. " (title LIKE '%SOMETHING%' AND NOT doktype) "

andWhere

SQL-where /stdWrap

Without "AND"!, Eg. "NOT doktype".

languageField

string

If set, this points to the field in the record which holds a reference to a record in sys_language table. And if set, the records returned by the select-function will be selected only if the value of this field matches the $GLOBALS[“TSFE”]->sys_language_uid (which is set by the config.sys_language_uid option)

selectFields

string

List of fields to select, or “count(*)”.

*

join

leftjoin

rightjoin

string

Enter tablename for JOIN , LEFT OUTER JOIN and RIGHT OUTER JOIN respectively.

[tsref:->select]

split

This object is used to split the input by a character and then parse the result onto some functions.

For each iteration the split index starting with 0 (zero) is stored in the register key SPLIT_COUNT.

Example:

This is an example of TypoScript-code that imports the content of field "bodytext" from the $cObj->data-array (ln 2). The content is split by the linebreak-character (ln 4). The items should all be treated with a stdWrap (ln 5) which imports the value of the item (ln 6). This value is wrapped in a tablerow where the first column is a bullet-gif (ln 7). Finally the whole thing is wrapped in the proper table-tags (ln 9)

1  20 = TEXT
2  20.field = bodytext
3  20.split {
4    token.char = 10
5    cObjNum = 1
6    1.current = 1
7    1.wrap = <TR><TD valign="top"><IMG src="dot.gif"></TD><TD valign="top"> | </TD></TR>
8  }
9  20.wrap = <TABLE border="0" cellpadding="0" cellspacing="3" width="368"> | </TABLE><BR>

Property:

Data type:

Description:

Default:

token

str /stdWrap

string or character (token) used to split the value

max

int /stdWrap

max number of splits

min

int /stdWrap

min number of splits.

returnKey

int /stdWrap

Instead of parsing the split result, just return this element of the index immediately.

cObjNum

cObjNum

+optionSplit

This is a pointer the array of this object ("1,2,3,4"), that should treat the items, resulting from the split.

1,2,3,4

->CARRAY /stdWrap

The object that should treat the value.

NOTE: The "current"-value is set to the value of current item, when the objects are called. See "stdWrap" / current.

Example (stdWrap used):

1.current = 1

1.wrap = <B> | </B>

Example (CARRAY used):

1 {

  10 = TEXT

  10.current = 1

  10.wrap = <B> | </B>

  20 = CLEARGIF

  20.height = 20

}

wrap

wrap

+optionSplit

Defines a wrap for each item.

[tsref:->split]

if

This function returns true if ALL of the present conditions are met (they are AND'ed). If a single condition is false, the value returned is false.

The returned value may still be negated by the ".negate"-property.

Property:

Data type:

Description:

Default:

isTrue

str /stdWrap

If the content is "true".... (not empty string and not zero)

isFalse

str /stdWrap

If the content is "false"... (empty or zero)

isPositive

int /stdWrap

+ calc

returns false if content is not positive

isGreaterThan

value /stdWrap

returns false if content is not greater than ".value"

isLessThan

value /stdWrap

returns false if content is not less than ".value"

equals

value /stdWrap

returns false if content does not equal ".value"

isInList

value /stdWrap

returns false if content is not in the comma-separated list ".value".

The list in ".value" may not have spaces between elements!!

value

value /stdWrap

"value" (the comparison value mentioned above)

negate

boolean

This negates the result just before it exits. So if anything above returns true the overall returns ends up returning false!!

directReturn

boolean

If this property exists the true/false of this value is returned. Could be used to set true/false by TypoScript constant

[tsref:->if]

Explanation

the "if"-function is a very odd way of returning true or false! Beware!

"if" is normally used to decide whether to render an object or return a value (see the cObjects and stdWrap)

Here is how it works:

The function returns true or false. Whether it returns true or false depends on the properties of this function. Say if you set "isTrue = 1" then result is true. If you set "isTrue.field = header" the function returns true if the field "header" in $cObj->data is set!

If you want to compare values, you must load a base-value in the ".value"-property. Example:

.value = 10
.isGreaterThan = 11

This would return true because the value of ".isGreaterThan" is greater than 10, which is the base-value.

More complex is this:

.value = 10
.isGreaterThan = 11
.isTrue.field = header
.negate = 1

There are two conditions - isGreaterThan and isTrue. If they are both true, the total is true (AND) BUT (!) the result if the function in total is false because the ".negate"-flag inverts the result!

Example:

This is a GIFBUILDER object that will write "NEW" on a menu-item if the field "newUntil" has a date less than the current date!

...
  30 = TEXT
  30.text = NEW!
  30.offset = 10,10
  30.if {
    value.data = date: U
    isLessThan.field = newUntil
    negate = 1
  }
...

typolink

Wraps the incoming value with link.

If this is used from parseFunc the $cObj->parameters-array is loaded with the link-parameters (lowercased)!

Property:

Data type:

Description:

Default:

extTarget

target /stdWrap

Target used for external links

_top

fileTarget

target /stdWrap

Target used for file links

target

target /stdWrap

Target used for internal links

no_cache

boolean /stdWrap

Adds a "&no_cache=1"-parameter to the link

useCacheHash

boolean

If set, the additionalParams list is exploded and calculated into a hashstring appended to the url, like “&cHash=ae83fd7s87”. When the caching mechanism sees this value, it calculates the same value on the server based on incoming values in HTTP_GET_VARS, excluding id,type,no_cache,ftu,cHash,MP values. If the incoming cHash value matches the calculated value, the page may be cached based on this.

The [SYS][encryptionKey] is included in the hash in order to make it unique for the server and non-predictable.

additionalParams

string /stdWrap

This is parameters that are added to the end of the url. This must be code ready to insert after the last parameter.

Example:

'&print=1'

'&sword_list[]=word1&sword_list[]=word2'

Applications:

This is very useful when linking to pages from a searchresult. The searchwords are stored in the register-key SWORD_PARAMS and can be insert directly like this:

.additionalParams.data = register:SWORD_PARAMS

NOTE: This is only active for internal links!

addQueryString

boolean

Add the QUERY_STRING to the start of the link. Notice that this does not check for any duplicate parameters! This is not a problem (only the last parameter of the same name will be applied), but enable "config.uniqueLinkVars" if you still don't like it.

.method: If set to to GET or POST then then the parsed query arguments (GET or POST data) will be used. This settings are useful if you use URL processing extensions like Real URL, which translate part of the path into query arguments.

It's also possible to get both, POST and GET data, on setting this to

"POST,GET" or "GET,POST". The last method in this sequence takes

precedence and overwrites the parts that are also present for the first

method.

.exclude: List of query arguments to exclude from the link (eg L or cHash).

wrap

wrap

Wraps the links.

ATagBeforeWrap

boolean

If set, the link is first wrapped with ".wrap" and then the <A>-tag.

parameter

string /stdWrap

This is the data, that ->typolink uses to create the link. The value is trimmed and if it's empty, ->typolink returns the input value untouched.

NOTE: If used from parseFunc, this value should be imported by:

typolink.parameter.data = parameters : allParams

Examples:

Internal links:

integers (51): creates a link to page with uid = 51

filerefs (fileadmin/somedir/thedoc.html): creates a link to the file on the local server.

strings (some_alias):  creates a link to the page with alias = "some_alias"

External links:

email-adresses (name@email.com): creates a link to the email-addr.

domains (www.domain.com): creates link to http://-page

The input is parsed like this:

First the parameter is splitted by character-space. This provides a way to pass more parameters. See "target" below here.

If a "@" is in the string, it's an email

If a period (.) is in the string AND if the period (.) is found before a slash (/) is found OR if a doubleslash is found, then it's a URL

If a slash (/) is found, it's a filereference. If the file/directory does not exist on the server, the link is NOT made!

Now the input can be an alias or page-id. If the input is an integer it will be treated as a page-id, if there are two comma separated integers, this indicates a pair of id and type. If there is at least one non numerical character, this will be recognized as an alias.

You can append a "#" to page-ids or aliases. Followed by another integer this will indicate a tt_content record on the page to jump to! (if .section-property is present, it overrides this).

If you insert only "#234" where "234" is a tt_content record number, or insert just a single "#" without any integers around it, the link will always point to the current page.

Notice: The parameter can contain a keyword that hands over link generation to an external function. See example below this table!

Target

Target is normally defined by the "extTarget" and "target" properties of typolink. But you may override this target by adding the new target after the parameter separated by a whitespace. Thus the target becomes the second parameter.

If the “Target” parameter is set to the “-” character, then it's the same as no target passed to the function. This feature enables you to still pass a class as third parameter and title as fourth parameter without setting the target also.

Open in windows with fixed dimensions (JavaScript)

It is possible to open the link in a window opened by JavaScript (with “window.open”). For this, just set the target value to “123x456” where 123 is the window width and 456 is the window height. You can also specify additional parameters to the function by entering them separated from the width and height with a colon “:”. For instance “230x450:resizable=0,location=1” will disable resizing of the window and enable the location bar.

Also see property “JSwindow”.

Class

If you specify a third parameter separated by whitespace in the parameter value this becomes the class-parameter of the link. This class parameter is inserted in the link-tag before any values from .ATagParams which means this class value will override any class value set in ATagParams (at least for MSIE). If set to “-”, then it's the same as no class passed to the function. This feature enables you to still pass a title as fourth parameter without setting the class also.

parameter

(continued)

Title

The title attribute is normally specified via .ATagParams or directly via the .title property. But you may override this value by adding the desired title as the fourth parameter (parameters separated by whitespace) to typolink.

Examples of multiparameters:

Consider this .parameter value passed to this function:

51  _blank  blueLink

This would result in a link approximately like this:

<a href=”?id=51” target=”_blank” class=”blueLink”>

title

string /stdWrap

Sets the title parameter of the A-tag.

JSwindow_params

string

Preset values for opening the window. This example lists almost all possible attributes:

status=1,menubar=1,scrollbars=1,resizable=1,location=1,directories=1,toolbar=1

returnLast

string

If set to "url" then it will return the URL of the link ($this->lastTypoLinkUrl)

If set to "target" it will return the target of the link.

So, in these two cases you will not get the value wrapped but the url or target value returned!

section

string /stdWrap

If this value is present, it's prepended with a "#" and placed after any internal url to another page in TYPO3.

This is used create a link, which jumps from one page directly the section on another page.

ATagParams

<A>-params /stdWrap

Additional parameters

Example:

class=”board”

linkAccessRestrictedPages

boolean

If set, typolinks pointing to access restricted pages will still link to the page even though the page cannot be accessed.

userFunc

function-name

This passes the link-data compiled by the typolink function to a user-defined function for final manipulation.

The $content variable passed to the user-function (first parameter) is an array with the keys “TYPE”,  “TAG”, “url”, “targetParams” and “aTagParams”.

TYPE is an indication of link-kind: mailto, url, file, page

TAG is the full <A>-tag as generated and ready from the typolink function.

The latter three is combined into the 'TAG' value after this formula:

<a href="'.$finalTagParts['url'].'"'.

           $finalTagParts['targetParams'].

           $finalTagParts['aTagParams'].'>

The userfunction must return an <A>-tag.

[tsref:->typolink]

Using link handlers

A feature (added in TYPO3 4.1) allows you to register a link handler for a keyword you define. For example, you can link to a page with id 34 with “<link 34>” in a typical bodytext field which converts <link> tags with “->typolink”. But what if you have an extension, “pressrelease”, and wanted to link to a press release item displayed by a plugin on some page you don't remember? With this feature its possible to create the logic for this in that extension.

So, in a link field (the “parameter” value for ->typolink) you could enter “pressrelease:123”:

Some TypoScript will usually transfer this value to the “parameter” attribute of the ->typolink call. When “pressrelease:123” enters ->typolink as the “parameter” it will be checked if “pressrelease” is a keyword with which a link handler is associated and if so, that handler is allowed to create the link.

Registering the handler for keyword “pressrelease” is done like this:

$TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler']['pressrelease'] = 'EXT:pressrelease/class.linkHandler.php:&tx_linkHandler';

The class file “pressrelease/class.linkHandler.php“ contains the class “tx_linkHandler” which could look like this:

class tx_linkHandler {
function main($linktxt, $conf, $linkHandlerKeyword, $linkHandlerValue, $link_param, &$pObj) {
$lconf = array();
$lconf['useCacheHash'] = 1;
$lconf['parameter'] = 34;
$lconf['additionalParams'] = '&tx_pressrelease[showUid]='.rawurlencode($linkHandlerValue);
return $pObj->typoLink($linktxt, $lconf);
}
}

In this function, the value part after the keyword is set as the value of a GET parameter, “&tx_pressrelease[showUid]” and the “parameter” value of a new ->typolink call is set to “34” which assumes that on page ID 34 a plugin is put that will display pressrelease 123 when called with &tx_pressrelease[showUid]=123. In addition you can see the “userCacheHash” attribute for the typolink function used in order to produce a cached display.

The link that results from this operation will look like this:

<a href="index.php?id=34&amp;tx_pressrelease[showUid]=123%3A456&amp;cHash=c0551fead6" >

The link would be encoded with RealURL and respect config.linkVars as long as ->typolink is used to generate the final URL.

textStyle

This is used to style text with a bunch of standard options + some site-specific.

Property:

Data type:

Description:

Default:

align.field

align

Set to fieldname from the $cObj->data-array

face.field

string

Set to fieldname from the $cObj->data-array

[1] = "Times New Roman";

[2] = "Verdana,Arial,Helvetica,Sans serif";

[3] = "Arial,Helvetica,Sans serif";

face.default

string /stdWrap

[default] = User defined

size.field

string

Set to fieldname from the $cObj->data-array

[1] = 1;

[2] = 2;

[3] = 3;

[10] = "+1";

[11] = "-1";

size.default

string /stdWrap

[default] = User defined

color.field

string

Set to fieldname from the $cObj->data-array

See "content.php" for the colors available

color.default

string /stdWrap

[default] = User defined

color.1

color.2

string

[1],[2] = User defined

properties.field

int

Set to fieldname from the $cObj->data-array

The property values goes like this:

bit 0: <B>

bit 1: <I>

bit 2: <U>

bit 3: (uppercase)

Thus a value of 5 would result in bold and underlined text

properties.default

int /stdWrap

[default] = User defined (This value will be used whenever ".field" is false!)

altWrap

wrap

If this value is set, the wrapping with a font-tag based on font,size and color is NOT done. Rather the element is wrapped with this value.

Use it to assign a stylesheet by setting this value to eg.

<div class=”text”> | </div>

[tsref:->textStyle]

encapsLines

Property:

Data type:

Description:

Default:

encapsTagList

list of strings

List of tags which qualify as encapsulating tags. Must be lowercase.

Example:

encapsTagList = div, p

This setting will recognize the red line below as encapsulated lines:

First line of text

Some <div>text</div>

<p>Some text</p>

<div>Some text</div>

<B>Some text</B>

remapTag.[tagname]

string

Enter a new tag name here if you wish the tagname of any encapsulation to be unified to a single tag name.

For instance, setting this value to “remapTags.P=DIV” would convert:

<p>Some text</p>

<div>Some text</div>

to

<div>Some text</div>

<div>Some text</div>

([tagname] is in uppercase.)

addAttributes.[tagname]

array of strings

Attributes to set in the encapsulation tag.

Example:

addAttributes.P {

  style=padding-bottom:0px; margin-top:1px; margin-bottom:1px;

  align=center

}

([tagname] is in uppercase.)

.setOnly =

exists : This will set the value ONLY if the property does not already exist

blank : This will set the value ONLY if the property does not already exist OR is blank (“”)

Default is to always override/set the attributes value.

removeWrapping

boolen

If set, then all existing wrapping will be removed.

This:

First line of text

Some <div>text</div>

<p>Some text</p>

<div>Some text</div>

<B>Some text</B>

becomes this:

First line of text

Some <div>text</div>

Some text

Some text

<B>Some text</B>

wrapNonWrappedLines

wrap

Wrapping for non-encapsulated lines

Example:

.wrapNonWrappedLines = <P>|</P>

This:

First line of text

<p>Some text</p>

becomes this:

<P>First line of text</P>

<p>Some text</p>

innerStdWrap_all

->stdWrap

Wraps the content inside all lines, whether they are encapsulated or not.

encapsLinesStdWrap.[tagname]

->stdWrap

Wraps the content inside all encapsulated lines.

([tagname] is in uppercase.)

defaultAlign

string /stdWrap

If set, this value is set as the default “align” value of the wrapping tags, both from .encapsTagList, .bypassEncapsTagList and .nonWrappedTag

nonWrappedTag

tagname

For all non-wrapped lines, you can set here which tag it should be wrapped in. Example would be “P”. This is an alternative to .wrapNonWrappedLines and has the advantage that it's attributes are set by .addAttributes as well as defaultAlign. Thus you can easier match the wrapping tags used for nonwrapped and wrapped lines.

[tsref:->encapsLines]

Example:

encapsLines {
  encapsTagList = div,p
  remapTag.DIV = P
  wrapNonWrappedLines = <P>|</P>
  innerStdWrap_all.ifEmpty = &nbsp;
}

This example shows how to handle content rendered by TYPO3 and stylesheets where the <P> tag is used to encapsulate each line.

Say, you have made this content with the Rich Text Editor:

This is line # 1 
[Above is an empty line!] 
<DIV align=right>This line is right-aligned</DIV>

After being processed by encapsLines with the above configuration, the content looks like this:

<P>This is line # 1 </P>
<P>&nbsp;</P>
<P>[Above is an empty line!] </P>
<P align="right">This line is right-aligned</P> 

Each line is nicely wrapped with <P> tags. The line from the database which was already wrapped (but in <DIV>-tags) has been converted to <P>, but keeps it's alignment. Overall, notice that the Rich Text Editor ONLY stored the line which was in fact right-aligned - every other line from the RTE was stored without any wrapping tags, so that the content in the database remains as human readable as possible.

Example:

# Make sure nonTypoTagStdWrap operates on content outside <typolist> and <typohead> only:
tt_content.text.20.parseFunc.tags.typolist.breakoutTypoTagContent = 1
tt_content.text.20.parseFunc.tags.typohead.breakoutTypoTagContent = 1
# ... and no <BR> before typohead.
tt_content.text.20.parseFunc.tags.typohead.stdWrap.wrap >
# Setting up  nonTypoTagStdWrap to wrap the text with P-tags
tt_content.text.20.parseFunc.nonTypoTagStdWrap >
tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines {
  encapsTagList = div,p
  remapTag.DIV = P
  wrapNonWrappedLines = <P style="margin:0 0 0;">|</P>
  # Forcing these attributes onto the encapsulation-tags if any
  addAttributes.P {
    style=margin:0 0 0;
  }
  innerStdWrap_all.ifEmpty = &nbsp;
  innerStdWrap_all.textStyle < tt_content.text.20.textStyle
}
# finally removing the old textstyle formatting on the whole bodytext part.
tt_content.text.20.textStyle >
# ... and <BR>-tag after the content is not needed either...
tt_content.text.20.wrap >

This is an example of how to wrap traditional tt_content bodytext with <P> tags, setting the line-distances to regular space like that generated by a <BR> tag, but staying compatible with the RTE features such as assigning classes and alignment to paragraphs.

tableStyle

This is used to style a table-tag. The input is wrapped by this table-tag

Property:

Data type:

Description:

Default:

align

align /stdWrap

border

int /stdWrap

cellspacing

int /stdWrap

cellpadding

int /stdWrap

color.field

string

Set to fieldname from the $cObj->data-array

color.default

color.1

color.2

string

[default],[1],[2] = User defined

params

<TABLE>-params

[tsref:->tableStyle]

Example:

styles.content.tableStyle {
  align.field = text_align
  border.field = table_border
  cellspacing.field = table_cellspacing
  cellpadding = 1
  color.field = table_bgColor
  color.default = {$styles.content.tableStyle.color}
  color.1 = {$styles.content.tableStyle.color1}
  color.2 = {$styles.content.tableStyle.color2}
}

addParams

Property:

Data type:

Description:

Default:

_offset

int

Use this to define which tag you want to manipulate.

1 is the first tag in the input, 2 is the second, -1 is the last, -2 is the second last

1

(array of strings)

string /stdWrap

This defines the content of each added property to the tag.

If there is a tag-property with this name already (case-sensitive!) that property will be overridden!

If the returned value is a blank string (but not zero!) then the existing (if any) property will not be overridden.

[tsref:->addParams]

Example:

page.13 = HTML
page.13.value = <tr><td valign=top>
page.13.value.addParams.bgcolor = {$menuCol.bgColor}
page.13.value.addParams._offset = -1 

Result example:

<tr><td valign="top" bgcolor="white">

(This example adds the 'bgColor' property to the value of the HTML cObject, if the content is not “”. (zero counts as a value here!))

filelink

Input is a filename in the path "path".

icon, size and file is rendered in the listed order.

Property:

Data type:

Description:

Default:

path

path /stdWrap

Example:

"/uploads/media/"

icon

boolean /stdWrap

Set if icon should be shown

icon_image_ext_list

list of imageextensions

This is the extensions that should render as thumbsnails instead of icons.

iconCObject

cObject

Enter a cObject to use alternatively for the icons, eg. IMAGE type.

If this is set, it'll substitute the use of the thumbs-script for display of thumbnails.

icon_link

boolean

If the icon should be linked also

labelStdWrap

->stdWrap

stdWrap options for the label (by default the label is the filename) before being wrapped with the A-tags.

Use this to eg. import another label from a database field or such.

wrap

wrap

Wraps the links.

ATagBeforeWrap

boolean

If set, the link is first wrapped with ".wrap" and then the <A>-tag.

file

->stdWrap

stdWrap of the label (by default the label is the filename) after having been wrapped with A-tag!

size

boolean /stdWrap

Set if size should be shown

jumpurl

boolean

Decides if the link should call the script with the jumpurl parameter in order to register any clicks in the stat.

This has the advantage that any clicks on the file will register in the stat.

The disadvantage is, that users cant right-click and select "Save Target As" in the browser.

Extra properties:

  .secure = [boolean]; If set, then the file pointed to by jumpurl is NOT redirected to, but rather it's read from the file and returned with a correct header. This option adds a hash and locationData to the url and there MUST be access to the record in order to download the file. If the fileposition on the server is furthermore secured by a .htaccess file preventing ANY access, you've got secure download here!

  .secure.mimeTypes = list of mimetypes, syntax [ext] = [mimetype]

Example:

jumpurl.secure = 1

jumpurl.secure.mimeTypes = pdf=application/pdf, doc=application/msword

target

target

stdWrap

->stdWrap

ATagParams

<A>-params /stdWrap

Additional parameters

Example:

class=”board”

removePrependedNumbers

boolean

if set, any 2-digit prepended numbers (“eg _23”) in the filename is removed.

altText

titleText

string /stdWrap

For icons (image made with "iconCObject" must have their own properties)

If no alttext is specified, it will use an empty alttext

emptyTitleHandling

string

Value can be “keepEmpty” to preserve an empty title attribute, or “useAlt” to use the alt attribute instead.

useAlt

longdescURL

string /stdWrap

For icons (image made with "iconCObject" must have their own properties)

"longdesc" attribute (URL pointing to document with extensive details about image).

[tsref:->filelink]

Example:

    1.filelink {
      path = uploads/media/
      icon = 1
      icon.wrap = <td> | </td>
      size = 1
      size.wrap = <td> | </td>
      file.fontTag = {$styles.content.uploads.wrap}
      file.wrap = <td> | </td>
      jumpurl = 1
      target = _blank
      stdWrap = <tr> | </tr>
    }

parseFunc

This object is used to parse some content for stuff like special typo tags, the "makeLinks"-things and so on...

Example:

This example takes the content of the field "bodytext" and parses it through the makelinks-functions and substitutes all <LINK> and <TYPOLIST>-tags with something else.

tt_content.text.default {
  20 = TEXT
  20.field = bodytext
  20.wrap = | <BR>
  20.brTag = <br>
  20.parseFunc {
    makelinks = 1
    makelinks.http.keep = path
    makelinks.http.extTarget = _blank
    makelinks.mailto.keep = path
    tags {
      link = TEXT
      link {
        current = 1
        typolink.extTarget = _blank
        typolink.target={$cLinkTagTarget} 
        typolink.wrap = <B><FONT color=red>|</FONT></B>
        typolink.parameter.data = parameters : allParams
      }
      typolist < tt_content.bullets.default.20
      typolist.trim = 1
      typolist.field >
      typolist.current = 1
    }
  }
}

Property:

Data type:

Description:

Default:

externalBlocks

list of tagnames/+properties

This allows you to pre-split the content passed to parseFunc so that only content outside the blocks with the given tags is parsed.

Extra properties:

.[tagname] {

  callRecursive = [boolean]; If set, the content of the block is directed into parseFunc again. Otherwise the content is just passed through with no other processing than stdWrap (see below)

  callRecursive.dontWrapSelf = [boolean]; If set, the tags of the block is not wrapped around the content returned from parseFunc.

  callRecursive.alternativeWrap = Alternative wrapping instead of the original tags.

  callRecursive.tagStdWrap = ->stdWrap processing of the block-tags.

  stdWrap = ->stdWrap processing of the whole block (regardless of whether callRecursive was set.)

  stripNLprev = [boolean]; Strips off last linebreak of the previous outside block

  stripNLnext = [boolean]; Strips off first linebreak of the next outside block

  stripNL = [boolean]: Does both of the above.

   HTMLtableCells = [boolean]; If set, then the content is expected to be a table and every table-cell is traversed.

   # Below, default is all cells and 1,2,3... overrides for specific cols.

   HTMLtableCells.[default/1/2/3/...] {

     callRecursive = [boolean]; The content is parsed through current parseFunc

      stdWrap = ->stdWrap processing of the content in the cell

      tagStdWrap = -> The <TD> tag is processed by ->stdWrap

   }

   HTMLtableCells.addChr10BetweenParagraphs = [boolean]; If set, then all </P><P> appearances will have a chr(10) inserted between them

}

Example:

This example is used to split regular bodytext content so that tables and blockquotes in the bodytext are processed correctly. The blockquotes are passed into parseFunc again (recursively) and further their top/bottom margins are set to 0 (so no apparent linebreaks are seen)

The tables are also displayed with a number of properties of the cells overridden.

tt_content.text.20.parseFunc.externalBlocks {

  blockquote.callRecursive=1

  blockquote.callRecursive.tagStdWrap.HTMLparser = 1

  blockquote.callRecursive.tagStdWrap.HTMLparser {

    tags.blockquote.fixAttrib.style.list = margin-bottom:0;margin-top:0;

    tags.blockquote.fixAttrib.style.always=1

  }

  blockquote.stripNLprev=1

  blockquote.stripNLnext=1

  table.stripNL=1

  table.stdWrap.HTMLparser = 1

  table.stdWrap.HTMLparser {

    tags.table.overrideAttribs = border=0 cellpadding=2 cellspacing=1 style="margin-top:10px; margin-bottom:10px;"

    tags.tr.allowedAttribs=0

    tags.td.overrideAttribs = valign=top bgcolor="#eeeeee" style="font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;font-size : 10px;"

  }

}

constants

boolean

The toplevel-defined constants will be substituted in the text. The constant-name is wrapped in "###".

Example:

constants.EMAIL =  email@email.com

(NOTE: This is toplevel TypoScript!)

All cases of the string ###EMAIL### will be substituted in the text. The constants are defined as a toplevel object.

short

array of strings

Like constants above, but local.

Example:

This substitutes all occurencies of “T3” with “TYPO3 CMS” and “T3web” with a link to typo3.com.

short {

  T3 = TYPO3 CMS

  T3web = <a href=”http://typo3.com”>typo3</a>

}

plainTextStdWrap

->stdWrap

This is stdWrap properties for all non-tag content.

userFunc

function name

This passes the non-tag content to a function of your own choice. Similar to eg. .postUserFunc in stdWrap.

Remember the function name must possibly be prepended “user_”

nonTypoTagStdWrap

->stdWrap

Like .plainTextStdWrap. Difference:

.plainTextStdWrap works an ALL non-tag pieces in the text. .nonTypoTagStdWrap is post processing of all text (including tags) between special TypoTags (unless .breakoutTypoTagContent is not set for the TypoTag)

nonTypoTagUserFunc

function name

Like .userFunc. Differences is (like nonTypoTagStdWrap) that this is post processing of all content pieces around TypoTags while .userFunc processes all non-tag content. (Notice: .breakoutTypoTagContent must be set for the TypoTag if it's excluded from nonTypoTagContent)

sword

wrap

Marks up any words from the GET-method send array sword_list[] in the text. The word MUST be at least two characters long!

NOTE: works only with $GLOBALS["TSFE"]->no_cache==1

<font color="red">|</font>

makelinks

boolean / ->makelinks

Convert webadresses prefixed with "http://" and mail-adresses prefixed with "mailto:" to links.

tags

->tags

Here you can define custom tags that will parse the content to something.

allowTags

list of strings

List of tags, which are allowed to exist in code!

Highest priority: If a tag is found in allowTags, denyTags is ignored!!

denyTags

list of strings

List of tags, which may NOT exist in code! (use "*" for all.)

Lowest priority: If a tag is NOT found in allowTags, denyTags is checked. If denyTags is not "*" and the tag is not found in the list, the tag may exist!

Example:

This allows <B>, <I>, <A> and <IMG> -tags to exist

.allowTags = b,i,a,img

.denyTags = *

if

->if

if "if" returns false the input value is not parsed, but returned directly.

[tsref:->parseFunc]

makelinks

makelinks substitutes all appearances of

http://www.webaddress.rld

mailto:name@email.rld

... to a real linktag

Property:

Data type:

Description:

Default:

http.extTarget

target

The target of the link

_top

http.wrap

wrap

wrap around the link

http.ATagBeforeWrap

boolean

If set, the link is first wrapped with http.wrap and then the <A>-tag.

http.keep

list: "scheme","path","query"

As default the link-text will be the full domain-name of the link.

Examples:

http://www.webaddress.rld/test/doc.php?id=3

"": www.webaddress.rld

"scheme": http://www.webaddress.rld

"scheme,path": http://www.webaddress.rld/test/doc.php

"scheme,path,query": http://www.webaddress.rld/test/doc.php?id=3

http.ATagParams

<A>-params /stdWrap

Additional parameters

Example:

class=”board”

mailto.wrap

wrap

wrap around the link

mailto.ATagBeforeWrap

boolean

If set, the link is first wrapped with mailto.wrap and then the <A>-tag.

mailto.ATagParams

<A>-params /stdWrap

Additional parameters

Example:

class=”board”

[tsref:->makelinks]

tags

Used to create custom tags and define how they should be parsed. This is used in conjunction with parseFunc.

Property:

Data type:

Description:

Default:

Array...

cObject +stripNL

+ breakoutTypoTagContent

Every entry in the Array... corresponds to a tag, that will be parsed. The elements MUST be in lowercase.

Every entry must be set to a content-object.

"current" is set to the content of the tag, eg <TAG>content</TAG>: here "current" is set to "content".

Parameters:

Parameters of the tag is set in $cObj->parameters (key is lowercased):

<TAG COLOR="red">content</TAG>

=> $cObj->parameters[color] = red

Special added properties to the content-object:

$cObj->parameters[allParams]:  this is automatically set to the whole parameter-string of the tag, eg ' color="red"'

[cObject].stripNL: is a boolean option, which tells parseFunc that NewLines before and after content of the tag should be stripped.

[cObject].breakoutTypoTagContent: is a boolean option, which tells parseFunc that this block of content is breaking up the nonTypoTag content and that the content after this must be re-wrapped.

Examples:

tags.bold = TEXT

tags.bold {

  current = 1

  wrap = <B> | </B>

}

tags.bold.stripNL = 1

[tsref:->tags]

Example:

This example creates 4 custom tags. The <LINK>-, <TYPOLIST>-, <GRAFIX>- and <PIC>-tags

<LINK> is made into a typolink and provides an easy way of creating links in text

<TYPOLIST> is used to create bullet-lists

<GRAFIX> will create a gif-file 90x10 pixels where the text is the content of the tag.

<PIC> lets us place an image in the text. The content of the tag should be the image-reference in "/fileadmin/"

    tags {
      link = TEXT
      link {
        current = 1
        typolink.extTarget = _blank
        typolink.target={$cLinkTagTarget} 
        typolink.wrap = <B><FONT color=red>|</FONT></B>
        typolink.parameter.data = parameters : allParams
      }
      typolist < tt_content.bullets.default.20
      typolist.trim = 1
      typolist.field >
      typolist.current = 1
      grafix = IMAGE 
      grafix {
        file = GIFBUILDER
        file {
          XY = 90,10
          100 = TEXT
          100.text.current = 1
          100.offset = 5,10
          100.nicetext = 1
        }
      }
      pic = IMAGE
      pic.file.import = fileadmin/
      pic.file.import.current = 1
    }

HTMLparser

Property:

Data type:

Description:

allowTags

list of tags

Default allowed tags

tags.[tagname]

boolean/->HTMLparser_tags

Either set this property to 0 or 1 to allow or deny the tag. If you enter ->HTMLparser_tags properties, those will automatically overrule this option, thus it's not needed then.

[tagname] in lowercase.

localNesting

list of tags, must be among preserved tags

List of tags (among the already set tags), which will be forced to have the nesting-flag set to true

globalNesting

(ibid)

List of tags (among the already set tags), which will be forced to have the nesting-flag set to “global”

rmTagIfNoAttrib

(ibid)

List of tags (among the already set tags), which will be forced to have the rmTagIfNoAttrib set to true

noAttrib

(ibid)

List of tags (among the already set tags), which will be forced to have the allowedAttribs value set to zero (which means, all attributes will be removed.

removeTags

(ibid)

List of tags (among the already set tags), which will be configured so they are surely removed.

keepNonMatchedTags

boolean / “protect”

If set (true=1), then all tags are kept regardless of tags present as keys in $tags-array.

If "protect", then the preserved tags have their <> converted to &lt; and &gt;

Default is to REMOVE all tags, which are not specifically assigned to be allowed! So you might probably want to set this value!

htmlSpecialChars

-1 / 0 / 1 / 2

This regards all content which is NOT tags:

“0” means “disabled” - nothing is done

“1” means the content outside tags is htmlspecialchar()'ed (PHP-function which converts &”<> to &...;)

“2” is the same as “1” but entities like “&amp;” or “&#234” are untouched.

“-1” does the opposite of “1” - converts &lt; to <, &gt; to >, &quot; to “ etc.

xhtml_cleaning

boolean

Cleans up the content for XHTML compliance. Still slightly experimental and supports only some clean up operations (like convertion tags and attributes to lower case).

[page:->HTMLparser; tsref:->HTMLparser]

HTMLparser_tags

Property:

Data type:

Description:

overrideAttribs

string

If set, this string is preset as the attributes of the tag.

allowedAttribs

'0' (zero) = no attributes allowed, '[commalist of attributes]' = only allowed attributes. If blank/not set, all attributes are allowed.

fixAttrib.[attribute].set

string

Force the attribute value to this value.

fixAttrib.[attribute].unset

boolean

 If set, the attribute is unset.

fixAttrib.[attribute].default

string

If no attribute exists by this name, this value is set as default value (if this value is not blank)

fixAttrib.[attribute].always

boolean

If set, the attribute is always processed. Normally an attribute is processed only if it exists

fixAttrib.[attribute].trim

fixAttrib.[attribute].intval

fixAttrib.[attribute].upper

fixAttrib.[attribute].lower

boolean

If any of these keys are set, the value is passed through the respective PHP-functions.

fixAttrib.[attribute].range

[low],[high]

Setting integer range.

fixAttrib.[attribute].list

list of values, trimmed

Attribute value must be in this list. If not, the value is set to the first element.

fixAttrib.[attribute].removeIfFalse

boolean/”blank” string

If set, then the attribute is removed if it is "false". If this value is set to "blank" then the value must be a blank string (that means a "zero" value will not be removed)

fixAttrib.[attribute].removeIfEquals

string

If the attribute value matches the value set here, then it is removed.

fixAttrib.[attribute].casesensitiveComp

boolean

If set, the comparison in .removeIfEquals and .list will be case-sensitive. At this point, it's insensitive.

fixAttrib.[attribute].prefixLocalAnchors

integer

If the first char is a “#” character (anchor of fx. <a> tags) this will prefix either a relative or absolute path.

If the value is “1” you will get the absolute path (t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'))

If the value is “2” you will get the relative path (stripping of t3lib_div::getIndpEnv('TYPO3_SITE_URL'))

Example:

...fixAttrib.href.prefixLocalAnchors = 1

fixAttrib.[attribute].prefixRelPathWith

string

If the value of the attribute seems to be a relative URL (no scheme like “http” and no “/” as first char) then that value of this property will be prefixed the attribute.

Example:

...fixAttrib.src.prefixRelPathWith = http://192.168.230.3/typo3/32/dummy/

fixAttrib.[attribute].userFunc

function reference

User function for processing of the attribute.

Example:

...fixAttrib.href.userFunc = tx_realurl->test_urlProc

protect

boolean

If set, the tag <> is converted to &lt; and &gt;

remap

string

If set, the tagname is remapped to this tagname

rmTagIfNoAttrib

boolean

If set, then the tag is removed if no attributes happend to be there.

nesting

If set true, then this tag must have starting and ending tags in the correct order. Any tags not in this order will be discarded. Thus '</B><B><I></B></I></B>' will be converted to '<B><I></B></I>'.

Is the value "global" then true nesting in relation to other tags marked for "global" nesting control is preserved. This means that if <B> and <I> are set for global nesting then this string '</B><B><I></B></I></B>' is converted to '<B></B>'

[page:->HTMLparser_tags; tsref:->HTMLparser_tags]