Attention
TYPO3 v6 has reached its end-of-life April 18th, 2017 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.
There is no further ELTS support. It is strongly recommended updating your project.
Soft References¶
"Soft References" are references to database elements, files, email
addresses, URLs etc. which are found inside text fields. The
<link[page_id]>
tag found in bodytext fields is an example of this.
The Soft Reference parsers are used by the system to find these references and process them accordingly in import/export actions and copy operations. Also, the soft references are used by integrity checking functions.
Default soft reference parsers¶
The TYPO3\CMS\Core\Database\SoftReferenceIndex class contains generic parsers for the most well-known types which are default for most TYPO3 installations. This is the list of the possible keys:
substitute¶
softref key
substitute
Description
A full field value targeted for manual substitution (for import /export features)
notify¶
softref key
notify
Description
Just report if a value is found, nothing more.
images¶
softref key
images
Description
HTML <img>
tags for RTE images / images from fileadmin/
.
typolink¶
softref key
typolink
Description
References to page id or file, possibly with anchor/target, possibly comma-separated list.
typolink_tag¶
softref key
typolink_tag
Description
As typolink, but searching for a <link>
tag encapsulating it.
TSconfig¶
softref key
TSconfig
Description
References to files.
TStemplate¶
softref key
TStemplate
Description
Free text references to "fileadmin/" files. HTML resource links like
<a>
, <img>
, <form>
.
ext_fileref¶
softref key
ext_fileref
Description
Relative file reference, prefixed EXT:[extkey]/
- for finding
extension dependencies.
email¶
softref key
Description
Email highlight.
url¶
softref key
url
Description
URL highlights (with a scheme).
The default set up is found in typo3/sysext/core/Configuration/DefaultConfiguration.php
:
'SC_OPTIONS' => array(
'GLOBAL' => array(
'softRefParser' => array(
'substitute' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'notify' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'images' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'typolink' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'typolink_tag' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'TSconfig' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'TStemplate' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'ext_fileref' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'email' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'url' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
),
...
),
...
),
User-defined soft reference parsers¶
Soft References can also be user-defined. It is easy to set them up by
simply adding new keys in
$TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['softRefParser']
. Use key
names based on the extension you put it in, e.g. tx_myextensionkey
.
The class containing the soft reference parser must have a function
named findRef
. Please refer to class
TYPO3\CMS\Core\Database\SoftReferenceIndex
for API usage and expected return values.