#89875slug config options should be configurable via TSConfig
Description
I would recommend to make some of the slug field options configurable via TSCONFIG
At least one Change would be required in sysext/backend/Classes/Form/Utility/FormEngineUtility.php
protected static $allowOverrideMatrix = [
‘input’ => [‘size’, ‘max’, ‘readOnly’],
‘text’ => [‘cols’, ‘rows’, ‘wrap’, ‘max’, ‘readOnly’],
‘check’ => [‘cols’, ‘readOnly’],
‘select’ => [‘size’, ‘autoSizeMax’, ‘maxitems’, ‘minitems’, ‘readOnly’, ‘treeConfig’],
‘group’ => [‘size’, ‘autoSizeMax’, ‘max_size’, ‘maxitems’, ‘minitems’, ‘readOnly’],
‘inline’ => [‘appearance’, ‘behaviour’, ‘foreign_label’, ‘foreign_selector’, ‘foreign_unique’, ‘maxitems’, ‘minitems’, ‘size’, ‘autoSizeMax’, ‘symmetric_label’, ‘readOnly’],
‘imageManipulation’ => [‘ratios’, ‘cropVariants’],
//NEW
‘slug’ => [‘fallbackCharacter’,‘generatorOptions’,‘prependSlash’]
];
This would result in an easy configuration of slug options via TSCONFIG f.e.
TCEFORM.pages.slug.config.fallbackCharacter=_
TCEFORM.pages.slug.config.generatorOptions.prefixParentPageSlug=0
Christoph
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[FEATURE] slug config options should be configurable via TSConfig Resolves: #89875 Releases: main
Related issues 1
History 3
-
Benni Mack changed Related to #88322 <span data-processor="relativetime" data-value="2020-10-01T00:01:01+00:00" > 10/01/20, 00:01 </span>
-
Benni Mack commented and changed status
NewAccepted target version <span data-processor="relativetime" data-value="2021-11-04T11:40:09+00:00" > 11/04/21, 11:40 </span> -
Benni Mack commented and changed status
AcceptedNeeds Feedback <span data-processor="relativetime" data-value="2026-10-15T16:08:17+00:00" > 10/15/26, 16:08 </span>Thanks for the suggestion, and sorry it took so long to come back to it.
After looking at it again, I don’t think TCEFORM is the right place for these options. TCEFORM only changes how FormEngine renders and edits a field (size, readOnly, items, labels). It never affects what gets saved.
fallbackCharacter,generatorOptionsandprependSlashdo exactly that: they decide the slug value that ends up in the database.The slug isn’t generated by FormEngine. Three places generate it, and they all read the TCA configuration:
-
DataHandler::checkValueForSlug()when a record is saved
-FormSlugAjaxControllerfor the “recalculate” button and the live preview in the form
- the redirectsSlugServicewhen child page slugs are updatedAdding
slugtoFormEngineUtility::$allowOverrideMatrixwould change only the form’s view of the field. The preview and the saved value would still use the TCA settings, and a CLI, import or DataHandler call would ignore the TSconfig completely. The same record could then get a different slug depending on how it was written.The settings you mention can already be changed per table, or per record type, in TCA:
// Configuration/TCA/Overrides/pages.php $GLOBALS['TCA']['pages']['columns']['slug']['config']['fallbackCharacter'] = '_'; $GLOBALS['TCA']['pages']['columns']['slug']['config']['generatorOptions']['prefixParentPageSlug'] = false;For a single record type, use
$GLOBALS['TCA'][<table>]['types'][<type>]['columnsOverrides']['slug']['config'].If you really need different slug rules for different page trees, that would be a new feature on the TCEMAIN side, not in TCEFORM. DataHandler, the AJAX controller and the redirects service would all have to read the same setting. Nobody has asked for that in the last years, so I’m closing this issue for now. If you have a concrete per-subtree use case, please open a new feature request describing it.
sounds reasonable