Project

General

Profile

Actions

Bug #89487

closed

Set pageTypes to ignore for slug generation

Added by Kay Strobach over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-10-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #87844: Add option to exclude pages from speaking urlClosed2019-03-05

Actions
Actions #1

Updated by Riccardo De Contardi over 4 years ago

I think that these issues are related:

#86216 , #87844

Is it correct?

Actions #2

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.

Actions #3

Updated by Riccardo De Contardi over 4 years ago

  • Related to Feature #87844: Add option to exclude pages from speaking url added
Actions #4

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.

Actions

Also available in: Atom PDF