Bug #89487
closedSet pageTypes to ignore for slug generation
0%
Description
in some cases we have special page types to structure content in the page tree.
these pages are use to give substructures in the fe, and might also be rendered in the fe.
But we want to exclude these pages from the slug generation.
page 1 page of type column --> page type 178 subpage
expected slugs
page : / page of type colum: /page-of-type-column subpage : /subpage
current slugs
page : / page of type colum: /page-of-type-column subpage : /page-of-type-column/subpage
The SlugHelper is already ignoring all page types from 199.
See public/typo3/sysext/core/Classes/DataHandling/SlugHelper.php:592
It would be a rather small change to check for additional page types, which should be ignored from the slug generation.
Backport to v9 appreciated
Updated by Riccardo De Contardi over 4 years ago
Updated by Kay Strobach over 4 years ago
class RemoveColumnsFromSlug { public function modifySlug( $config ) { $parts = explode('/', $config['prefix']); $lastPart = array_pop($parts); if (strpos($lastPart, 'spalte') === 0) { return str_replace($config['prefix'], implode('/', $parts), $config['slug']); } return $config['slug']; } }
$GLOBALS['TCA']['pages']['columns']['slug']['config']['generatorOptions']['postModifiers'][] = \Drk\DrkTemplate\Hooks\SlugGenerator\RemoveColumnsFromSlug::class . '->modifySlug';
more info can be found here:
just found a way to fix it with another convention that is used here, maybe this can be improved lateron, please close issue for now.
Updated by Riccardo De Contardi over 4 years ago
- Related to Feature #87844: Add option to exclude pages from speaking url added
Updated by Riccardo De Contardi over 4 years ago
- Status changed from New to Closed
- Target version deleted (
next-patchlevel)
Closed as per request of the reporter;
The workaround mentioned here uses the modifier reported here: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.5.x/Feature-88198-TCA-basedSlugModifiersForExtensions.html
I add a relation to #87844 to keep track of it; please continue the discussion for this feature there.
Thank you.