This function is often added as a property to values in TypoScript.
Example with the property "value" of 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, where you will find the function stdWrap() and the array $stdWrapOrder, which represents the exact order of execution.
The properties in this table are 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 | Field name | 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 field names 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 happened now (data, field, current, listNum, trim). Zero 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 | Field name | 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 <myTag> 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 "Core API" 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 error checking 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); | |
numberFormat | ->numberFormat | Format a float value to any number format you need (e.g. useful for prices). | |
date | date-conf | The content should be data-type "UNIX-time". Returns the content formatted as a date. PHP: $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 eight variations: "xx min" or "xx hrs" or "xx days" or "xx yrs" or "xx min" or "xx hour" or "xx day" or "year" The limits between which layout is used are 60 minutes, 24 hours and 365 days. If you set this property with a non-integer, it is used to format the eight units. The first four values are the plural values and the last four are singular. This is the default string: " min| hrs| days| yrs| min| hour| day| year" Set another string if you want to change the units. You may include the "-signs. They are removed anyway, but they make sure that a space which you might want between the number and the unit stays. Example: lib.ageFormat = TEXT lib.ageFormat.data = page:tstamp lib.ageFormat.age = " Minuten | Stunden | Tage | Jahre | Minute | Stunde | Tag | Jahr" | |
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] sent 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 line breaks to <br />-tags. | |
brTag | string | All ASCII-codes of "10" (CR) are substituted with value. | |
encapsLines | ->encapsLines | Lets you split the content by chr(10) and process 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-separated 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 an 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 field names[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>: Useful 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 contains the properties that are used with the data type imgResource.
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 height 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 height are set and at least one of the numbers is appended by a "c", crop-scaling 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. | |
noScale | boolean /stdWrap | If set, the image itself will never be scaled. Only width and height are calculated according to the other properties, so that the image is displayed resizedly, but the original file is used. Can be used for creating PDFs or printing of pages, where the original file could provide much better quality than a rescaled one. Example: // test.jpg could e.g. have 1600 x 1200 pixels file = test.jpg file.width = 240m file.height = 240m file.noScale = 1 This example results in an image tag like the following. Note that src="test.jpg" is the original file: <img src="test.jpg" width="240" height="180" /> | 0 |
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]
This object wraps the input (an image) with a link ready for calling up the eID "tx_cms_showpic" script 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 the "tx_cms_showpic" script 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.
Since TYPO3 4.5 it is also possible to display the image in a lightbox instead of using showpic.php. See the property "linkParams" below for a short instruction.
Property: | Data type: | Description: | Default: |
---|---|---|---|
file | stdWrap | Override the path of the image which is displayed | |
width | int (1-1000) /stdWrap | 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) /stdWrap | see ".width" | |
effects | see GIFBUILDER / effects. (from stdgraphics-library) /stdWrap | Example: gamma=1.3 | sharpen=80 | solarize=70 | |
sample | boolean /stdWrap | If set, -sample is used to scale images instead of -geometry. Sample does not use antialiasing and is therefore much faster. | |
alternativeTempPath | path /stdWrap | Enter an alternative path to use for temp images. Must be found in the list in $TYPO3_CONF_VARS['FE']['allowedTempPaths']. | |
title | string /stdWrap | page title of the new window (HTML) | |
bodyTag | <tag> /stdWrap | Body tag of the new window | |
wrap | wrap /stdWrap | Wrap of the image, which is output between the body-tags | |
target | <A>-data:target /stdWrap | NOTE: Only if ".JSwindow" is set | |
JSwindow | boolean /stdWrap | If set to "1", the image will be opened in a new window which is fitted to the dimensions of the image! You can also use stdWrap here. | |
JSwindow.expand | x,y /stdWrap | x and y is added to the window dimensions. | |
JSwindow.newWindow | boolean /stdWrap | 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 tx_cms_showpic 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 user function instead. | |
typolink | ->typolink | NOTE: This overrides the imageLinkWrap if it returns anything!! | |
directImageLink | boolean /stdWrap | If true, a link to the generated image file will be returned directly (which means that showpic.php will not be used). | 0 |
linkParams | ->typolink | Allows manipulation of the generated typolink, if JSwindow is not used. Example: JSwindow = 0 directImageLink = 1 linkParams.ATagParams.dataWrap = class="{$styles.content.imgtext.linkWrap.lightboxCssClass}" rel="{$styles.content.imgtext.linkWrap.lightboxRelAttribute}" With these options it is easy to use a lightbox of your choice to display resizable images in the frontend: You only need to integrate the lightbox by including its JS and CSS files and to activate it for certain links (e.g. for links with the class "lightbox"). | |
stdWrap | ->stdWrap | Enable stdWrap for the image | |
enable | boolean /stdWrap | The image is linked ONLY if this is true!! | 0 |
[tsref:->imageLinkWrap]
This object returns the number of rows.
Property: | Data type: | Description: | Default: |
---|---|---|---|
table | Table name | ||
select | ->select | Select query for the operation. The property "selectFields" is overridden internally with "count(*)". |
[tsref:->numRows]
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 $TCA (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 /stdWrap | Without "order by"! Eg. "sorting, title" | |
groupBy | SQL-groupBy /stdWrap | 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(*)". If the records need to be localized, please include the relevant localization-fields (uid,pid,languageField,transOrigPointerField). Otherwise the TYPO3 internal localization will not succeed. | * |
join leftjoin rightjoin | string | Enter tablename for JOIN , LEFT OUTER JOIN and RIGHT OUTER JOIN respectively. | |
markers | array of markers | The markers defined in this section can be used, wrapped in the usual ###markername### way, in any other property of select. Each value is properly escaped and quoted to prevent SQL injection problems. This provides a way to safely use external data (e.g. database fields, GET/POST parameters) in a query. <markername>.value (value) Sets the value directly. <markername>.commaSeparatedList (bool) If set, the value is interpreted as a comma-separated list of values. Each value in the list is individually escaped and quoted. (stdWrap properties ...) All stdWrap properties can be used for each markername. Example: page.60 = CONTENT page.60 { table = tt_content select { pidInList = 73 where = header != ###whatever### orderBy = ###sortfield### markers { whatever.data = GP:first sortfield.value = sor sortfield.wrap = |ting } } } |
[tsref:->select]
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.
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 /stdWrap | 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 /stdWrap | Defines a wrap for each item. |
[tsref:->split]
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]
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!
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 hash string 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 $TYPO3_CONF_VARS['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 – for example – when linking to pages from a search result. The search words 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). | |
jumpurl | boolean | Decides if the link should call the script with the jumpurl parameter in order to register any clicks in the statistics. This works the same way as "filelink.jumpurl" does – for more details see the description there. Example: lib.parseFunc_RTE.tags.link { typolink.jumpurl = 1 typolink.jumpurl.secure = 1 typolink.jumpurl.secure.mimeTypes = pdf=application/pdf, doc=application/msword, png=image/png, gif=image/gif, jpg=image/jpg } These settings in the TS template will make any link to an internal file inserted in the RTE be rendered as a secure file download. | 0 |
wrap | wrap /stdWrap | 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 main data that is used for creating the link. It can be the id of a page, the URL of some external page, an e-mail address or a reference to a file on the server. On top of this there can be additional information for specifying a target, a class and a title. Below are a few examples followed by full explanations. Examples: parameter = 51 Most simple. Will create a link page 51. parameter = 51 _blank specialLink "Very important information" A full example. A link to page 51 that will open in a new window. The link will a class attribute with value "specialLink" and a title attribute reading "Very important information". So the result will be the following: <a href="?id=51" target="_blank" class="specialLink" title="Very important information"> parameter = http://typo3.org/ - specialLink An external link with a class attribute. Note the dash (-) that replaces the second value (the target). This makes it possible to define a class (third value) without having to define a class. parameter = info@typo3.org - - "Send a mail to main TYPO3 contact" Create a mailto link with a title attribute (but no target and no class) As you can see from the examples, each significant part of the parameter string is separated by a space. Values that can themselves contain spaces must be enclosed in double quotes. Each of these values are described in more detail below. Destination The first value is the destination of the link. If there's a @ it will be considered to be a mail address and a mailto link will be created. If the value contains a dot (.) before the first slash (/) or a double slash (//) or if a scheme (like http) is found inside it, the link will be considered to be an external one. If there's a slash but not a dot before it, it is considered to be a path to a file and link is made to it (even if it doesn't exist as it must consider that it might be a speaking URL). In all other cases it is assumed that the value is either a page id and a page alias and a link is made to that page, if it exists. In the case of a link to a page, the value can be more complex than just a number or an alias. There can be three "sub-values" separated by commas. Here's an example: typolink.parameter = 51,100,&test=1 - - "RSS Feed" The first value is the page id, the second is the type, the third will override the "additionalParams" property. It's also possible to specify a section that will override the section property. If the section mark is an integer, it will be considered as a pointer to a tt_content record. If not, it's used as is. If there's only a section mark, the link is made to the current page. Examples: typolink.parameter = 51#345 Create a link to page 51 with an anchor to tt_content element number 345 typolink.parameter = #top Create a link to the current page with an anchor called "top". It's also possible to direct the typolink to use a custom function (a "link handler") to build the link. This is described in more details below this table. Target or popup settings Targets are normally defined the properties described above (extTarget, fileTarget and target) but it is possible to override them by explicitly defining a target in the parameter property. It's possible to use a dash (-) to skip this value when one wants to define a third or fourth value, but no target (see examples above). Instead of a target, this second value can be used to define the parameters of a JavaScript popup window into which the link will be opened (using window.open). The height and width of the window can be defined, as well as additional parameters to be passed to the JavaScript function. Also see property "Jswindow". Examples: typolink.parameter = 51 400x300 Open page 51 in a popup window measuring 400 by 300 pixels typolink.parameter = 51 400x300:resizable=0,location=1 Same as above, but window will not be resizable and will show the location bar Class The third value can be used to define a class name for the link tag. This class is inserted in the tag before any other value from the "ATagParams" property. Beware of conflicting class attributes. It's possible to use a dash (-) to skip this value when one wants to define a fourth value, but no class (see examples above). Title The standard way of defining the title attribute of the link would be to use the "title" property or even the "ATagParams" property. However it can also be set in this fourth value, in which case it will override the other settings. Note that the title should be wrapped in double quotes (") if it contains blanks. Note: When used from parseFunc, the value should not be defined explicitly, but imported using: typolink.parameter.data = parameters : allParams | |
forceAbsoluteUrl | boolean | Forces links to internal pages to be absolute, thus having a proper URL scheme and domain prepended. Additional property: .scheme: Defines the URL scheme to be used (https or http). http is the default value. Example: typolink { parameter = 13 forceAbsoluteUrl = 1 forceAbsoluteUrl.scheme = https } | 0 |
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]
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 it's 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&tx_pressrelease[showUid]=123%3A456&cHash=c0551fead6" >
The link would be encoded with RealURL and respect config.linkVars as long as ->typolink is used to generate the final URL.
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 field name from the $cObj->data-array | |
face.field | string | Set to field name 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 field name 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 field name 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 field name 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]
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 | boolean | 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 non-wrapped and wrapped lines. |
[tsref:->encapsLines]
encapsLines {
encapsTagList = div,p
remapTag.DIV = P
wrapNonWrappedLines = <P>|</P>
innerStdWrap_all.ifEmpty =
}
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> </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.
# 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 =
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.
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 field name from the $cObj->data-array | |
color.default color.1 color.2 | string | [default],[1],[2] = User defined | |
params | <TABLE>-params |
[tsref:->tableStyle]
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}
}
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]
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!))
Input is a filename in the path "path".
icon, size and file are 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 image extensions /stdWrap | This is the extensions that should render as thumbnails instead of icons. | |
iconCObject | cObject | Enter a cObject to use alternatively for the icons, e.g. 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 /stdWrap | 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 file position 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] .parameter = [string/stdWrap] By default the jumpurl link will use the current pid and typeNum. If you need alternative values (e.g. for logging) you can specify them here. For options see typolink.parameter. 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 /stdWrap | 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]
With this property you can format a float value and display it as you want, for example as a price. It is a wrapper for the number_format() function of PHP.
You can define how many decimals you want and which separators you want for decimals and thousands.
Since the properties are finally used by the PHP function number_format(), you need to make sure that they are valid parameters for that function. Consult the PHP manual, if unsure.
Property: | Data type: | Description: | Default: |
---|---|---|---|
decimals | integer /stdWrap | Number of decimals the formatted number will have. Defaults to 0, so that your input will in that case be rounded up or down to the next integer. | 0 |
dec_point | string /stdWrap | Character that divides the decimals from the rest of the number. Defaults to ".". | . |
thousands_sep | string /stdWrap | Character that divides the thousands of the number. Defaults to ","; set an empty value to have no thousands separator. | , |
[tsref:->numberFormat]
lib.myPrice = TEXT
lib.myPrice {
value = 0.8
numberFormat {
decimals = 2
dec_point.cObject = TEXT
dec_point.cObject {
value = .
lang.de = ,
}
}
noTrimWrap = || €|
}
# Will basically result in "0.80 €", but for German in "0,80 €".
lib.carViews = CONTENT
lib.carViews {
table = tx_mycarext_car
select.pidInList = 42
renderObj = TEXT
renderObj {
field = views
# By default use 3 decimals or
# use the number given by the Get/Post variable precisionLevel, if set.
numberFormat.decimals = 3
numberFormat.decimals.override.data = GP:precisionLevel
numberFormat.dec_point = ,
numberFormat.thousands_sep = .
}
}
# Could result in something like "9.586,007".
This object is used to parse some content for stuff like special typo tags, the "makeLinks"-things and so on...
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 line breaks 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 top-level defined constants will be substituted in the text. The constant-name is wrapped in "###". Example: constants.EMAIL = email@email.com (NOTE: This is top-level TypoScript!) All cases of the string ###EMAIL### will be substituted in the text. The constants are defined as a top-level object. | |
short | array of strings | Like constants above, but local. Example: This substitutes all occurrences 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 e.g. .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 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 /stdWrap | 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 /stdWrap | 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]
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]
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
}
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 < and > 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 "&" or "ê" are untouched. "-1" does the opposite of "1" - converts < to <, > to >, " to " etc. |
xhtml_cleaning | boolean | Cleans up the content for XHTML compliance. Still slightly experimental and supports only some clean up operations (like conversion tags and attributes to lower case). |
[page:->HTMLparser; tsref:->HTMLparser]
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 < and > |
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]