Attention
TYPO3 v9 has reached its end-of-life September 30th, 2021 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.
You can order Extended Long Term Support (ELTS) here: TYPO3 ELTS.
HTMLparser_tags¶
overrideAttribs¶
- Property
overrideAttribs
- Data type
- Description
If set, this string is preset as the attributes of the tag.
allowedAttribs¶
- Property
allowedAttribs
- Data type
mixed
- Description
Defines the allowed attributes.
Possible values:
- 0
No attributes allowed.
- (comma-separated list of attributes)
Only attributes in this list are allowed.
- (blank/not set)
All attributes are allowed.
fixAttrib.[attribute].set¶
- Property
fixAttrib.[attribute].set
- Data type
- Description
Force the attribute value to this value.
fixAttrib.[attribute].unset¶
- Property
fixAttrib.[attribute].unset
- Data type
- Description
If set, the attribute is unset.
fixAttrib.[attribute].default¶
- Property
fixAttrib.[attribute].default
- Data type
- Description
If no attribute exists by this name, this value is set as default value (if this value is not blank)
fixAttrib.[attribute].always¶
- Property
fixAttrib.[attribute].always
- Data type
- Description
If set, the attribute is always processed. Normally an attribute is processed only if it exists
- Property
fixAttrib.[attribute].trim
fixAttrib.[attribute].intval
fixAttrib.[attribute].upper
fixAttrib.[attribute].lower
- Data type
- Description
If any of these keys are set, the value is passed through the respective PHP-functions.
fixAttrib.[attribute].range¶
- Property
fixAttrib.[attribute].range
- Data type
[low],[high]
- Description
Setting integer range.
fixAttrib.[attribute].list¶
- Property
fixAttrib.[attribute].list
- Data type
list of values, trimmed
- Description
Attribute value must be in this list. If not, the value is set to the first element.
fixAttrib.[attribute].removeIfFalse¶
- Property
fixAttrib.[attribute].removeIfFalse
- Data type
boolean /
blank
string- Description
If set, then the attribute is removed if it is false (=
0
). If this value is set toblank
then the value must be a blank string (that means a "zero" value will not be removed).
fixAttrib.[attribute].removeIfEquals¶
- Property
fixAttrib.[attribute].removeIfEquals
- Data type
- Description
If the attribute value matches the value set here, then it is removed.
fixAttrib.[attribute].casesensitiveComp¶
- Property
fixAttrib.[attribute].casesensitiveComp
- Data type
- Description
If set, the comparison in fixAttrib.[attribute].removeIfEquals and fixAttrib.[attribute].list will be case-sensitive. At this point, it's insensitive.
fixAttrib.[attribute].prefixLocalAnchors¶
- Property
fixAttrib.[attribute].prefixLocalAnchors
- Data type
- Description
If the first char is a "#" character (anchor of fx.
<a>
tags) this will prefix either a relative or absolute path.1
will get the absolute path (
TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')
).2
will get the relative path (stripping of
TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL')
).
- Example
...fixAttrib.href.prefixLocalAnchors = 1
fixAttrib.[attribute].prefixRelPathWith¶
- Property
fixAttrib.[attribute].prefixRelPathWith
- Data type
- Description
If the value of the attribute seems to be a relative URL (no scheme like "http" and no "/" as first char) then the value of this property will be prefixed the attribute.
- Example
...fixAttrib.src.prefixRelPathWith = https://example.org/typo3/32/dummy/
fixAttrib.[attribute].userFunc¶
- Property
fixAttrib.[attribute].userFunc
- Data type
- Description
User function for processing of the attribute. The return value of this function will be used as the new tag value.
- Example
...fixAttrib.href.userFunc = \Vendor\ExtName\ClassName->function
Two parameters are passed to the function:
The tag value as a string or an array containing the tag value and additional configuration (see below).
The reference the to HtmlParser instance that calls the method.
By default the first parameter is the value of the processed tag. This changes when you pass additional configuration options to the user function:
...fixAttrib.href.userFunc.myCustomParm = myCustomValue
In that case the first parameter passed to the user function will be an array containing these values:
protect¶
- Property
protect
- Data type
- Description
If set, the tag
<>
is converted to<
and>
rmTagIfNoAttrib¶
- Property
rmTagIfNoAttrib
- Data type
- Description
If set, then the tag is removed if no attributes happened to be there.
nesting¶
- Property
nesting
- Data type
mixed
- Description
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>