Bug #89390
closedSlug generation: Fallback fields seems not to work
100%
Description
TYPO3 9.5.9
Target: We want to use pages.nav_title for slug generation of pages and if nav_title is empty, title should be used instead.
Luckily there is a good documentation that describes this scenario exactly:
https://docs.typo3.org/m/typo3/reference-tca/9.5/en-us/ColumnsConfig/Type/Slug.html#generatoroptions
Problem: If pages.nav_title and pages.title is filled and the slug will be regenerated, values of both fields are used to fill the slug.
If I follow the recommendation, this TCA should work as described:
$GLOBALS['TCA']['pages']['columns']['slug']['config']['generatorOptions']['fields'] = ['nav_title', 'title'];
The complete TCA for pages.slug:
The problem:
Updated by Alex Kellner about 5 years ago
The correct configuration would be:
$GLOBALS['TCA']['pages']['columns']['slug']['config']['generatorOptions']['fields'] = [['nav_title', 'title']];
Please close this issue (and maybe a documentation update would be fine for the next integrator)
Updated by Georg Ringer about 5 years ago
- Status changed from New to Closed
thanks, opened issue https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-TCA/issues/244
Updated by Daniel Siepmann about 5 years ago
There were Pull Requests fixing wrong documentation. Thanks for pointing out.
Updated by Sybille Peters about 1 year ago
- Status changed from Closed to New
- Assignee set to Sybille Peters
reopening, will create patch.
Changelog should be handled as core / issue patch, changelog is: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/9.5.x/Feature-87085-FallbackOptionsForSlugFields.html#examples
Changes for the "TCA References" should be handled as GitHub issues / PR, see
- TCA Reference => slug => generatorOption => field
- Issue on GitHub: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-TCA/issues/244
The examples 2 and 3 in the changelog are wrong: the configuration will result in concatenated slugs, but the results are shown as not concatenated.
Using ['nav_title', 'title'] would not result in /best-products, but result in /best-products/products.
We could fix the examples like this:
Example 2:
Use [['nav_title', 'title']] instead of ['nav_title', 'title'] (which was probably the intention in the first place).
Updated by Gerrit Code Review about 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81723
Updated by Gerrit Code Review about 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81726
Updated by Gerrit Code Review about 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81727
Updated by Sybille Peters about 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 8005338756872beb551cb4a005c514603f33c77d.