Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
suggestOptions
suggestOptions
-
- Type
- array
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']
- Scope
- Display
- InternalType
- db
Optional, additional suggest options used if the suggest wizard is not hidden. The suggest wizard options can also be overriden on a page TSconfig level.
Suggestions can be configured differently for each table. Settings in "default" are applied to all tables. In the example below, there is a special setting for the "pages" table to search only standard pages.
'related_records' => [ 'label' => 'Related records', 'config' => [ 'type' => 'group', 'internal_type' => 'db', 'allowed' => 'pages, tt_content', 'suggestOptions' => [ 'default' => [ 'searchWholePhrase' => 1 ], 'pages' => [ 'searchCondition' => 'doktype = 1' ] ] ] ],
Copied!- additionalSearchFields (string)
- Comma-separated list of fields the suggest wizard should also search in. By default the wizard looks only in the fields listed in the label and label_alt of TCA ctrl properties.
- addWhere (string)
-
Allows to define an additional where clause for the searchquery. It supplies a marker for ###THIS_UID### which is useful to exclude the current record.
Note
Basically identical to 'searchCondition' - one will vanish sooner or later.
- cssClass (string)
- Add a CSS class to every list item of the result list.
- maxItemsInResultList (integer)
- Maximum number of results to display, default is
10
. - maxPathTitleLength (integer)
- Maximum number of characters to display when a path element is too long.
- minimumCharacters (integer)
- Minimum number of characters needed to start the search. Works only in "default" configuration array.
- orderBy (string)
- Allows to add an
ORDER BY
part to the search query. - pidList (list of values)
-
Limit the search to certain pages (and their sub pages). When pidList is empty all pages will be included in the search (as long as the be_user is allowed to see them).
Example
'storage_pid' => [ 'config' => [ 'suggestOptions' => [ 'default' => [ 'pidList' => '1,2,3,45', ], ], ], ],
Copied! - pidDepth (integer)
-
Expand pidList by this number of levels. Has an effect only if pidList has a value.
Example
'storage_pid' => [ 'config' => [ 'suggestOptions' => [ 'default' => [ 'pidList' => '6,7', 'pidDepth' => 4 ], ], ], ],
Copied! - receiverClass (string)
- PHP class alternative receiver class, default is
TYPO3\\
. Can be used to implement an own search strategy.CMS\\ Backend\\ Form\\ Wizard\\ Suggest Wizard Default Receiver - renderFunc (string)
- User function to manipulate the displayed records in the results.
- searchCondition (string)
-
Additional WHERE clause (not prepended with
AND
).Note
Basically identical to 'addWhere' - one will vanish sooner or later.
Example
'storage_pid' => [ 'config' => [ 'suggestOptions' => [ // configures the suggest wizard for the field "storage_pid" // in table "pages" to search only for pages with doktype=1 'pages' => [ 'searchCondition' => 'doktype=1', ], ], ], ],
Copied! - searchWholePhrase (boolean)
-
Whether to do a
LIKE=%mystring%
(searchWholePhrase = 1) or aLIKE=mystring%
(to do a real find as you type), default is0
.Example
'storage_pid' => [ 'config' => [ 'suggestOptions' => [ 'default' => [ 'searchWholePhrase' => 1, ], ], ], ],
Copied!
Examples
Only show pages with doktype=1 in the suggest options
[
'columns' => [
'group_db_10' => [
'exclude' => 1,
'label' => 'group_db_10 allowed=pages size=1',
'config' => [
'type' => 'group',
'allowed' => 'pages',
'maxitems' => 1,
'minitems' => 0,
'size' => 1,
'suggestOptions' => [
'default' => [
'additionalSearchFields' => 'nav_title, alias, url',
'addWhere' => 'AND pages.doktype = 1',
],
],
],
],
],
]