Project

General

Profile

Actions

Bug #86596

closed

Slash in Page Title still in URL

Added by Kalle Karlson over 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2018-10-08
Due date:
% Done:

0%

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

Description

If the page title contains a slash like in "Sanitär / Installation" the generated url looks like "/sanitaer-/-installation".

The slash should not appear in the URL, cause its a directory seperator sign, so from an seo perspective the request is treated wrong.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #86740: Using slash in slug in extension record throws exception in frontendClosed2018-10-25

Actions
Related to TYPO3 Core - Bug #88291: Exception thrown if slash in route field of PersistedPatternMapper aspectClosed2019-05-07

Actions
Actions #1

Updated by Josef Glatz over 5 years ago

Thanks for your issue!

Just by reading the ChangeLog RsT document of the new feature this seems to be intended by the core team.

According https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/9.4/Feature-84729-NewTCATypeSlug.html?highlight=contain%20slashes

...
In contrast to concepts within RealURL of "URL segments", a slug is a segment of a URL, but it is not limited to be separated by slashes. Therefore, a slug can contain slashes.
...

IMO from an SEO guru / backend Editor / and even a backend editor who came into contact with Realurl with TYPO3 < v9 before

It may make sense to make the Replace Character Map configurable in \TYPO3\CMS\Core\DataHandling\SlugHelper maybe. Especially if other languages ​​are used where there some other characters needs to be replaced by the fallbackCharactar. I think there will be situations, where TYPO3 must provide some configuration options to facilitate the work of the backend editor in creating slugs.

As a workaround you can manually adopt the slug field content to your needs


Since I'm not familiar with the Insights of the new feature, we can only wait for an answer from the Core Team

Actions #2

Updated by Kalle Karlson over 5 years ago

Thank you for your answer, but I think it's wrong to refer only on realurl behavior. The slash is a reserved character like mentioned in RFC1738 (http://www.ietf.org/rfc/rfc1738.txt )

An HTTP URL takes the form:

      http://<host>:<port>/<path>?<searchpart>
[...]

   Within the <path> and <searchpart> components, "/", ";", "?" are
   reserved.  The "/" character may be used within HTTP to designate a
   hierarchical structure.

So imho the slash has to be removed or encoded.

Actions #3

Updated by Georg Ringer over 5 years ago

but the code doesn't know if you would like to have a heirachical structure like sanitär/installation or if it should be - used.

or do you see a way?

Actions #4

Updated by Georg Ringer over 5 years ago

  • Status changed from New to Needs Feedback
Actions #5

Updated by Kalle Karlson over 5 years ago

The Pagetitle is always the last part of the heirachical structure. If I want different "folders" I should organize my content with parent pages so that "Sanitär" and "Installation" are two different pages. The URL should respect the backend tree structure. The default case should be that the slash is stripped from URL on auto generate, if I want a slash at this position I can add it manually.

Actions #6

Updated by Georg Ringer over 5 years ago

I understand what you write and still the question: technically it is not possible to know if an editor wants to have the slash from the beginning on because he wants it that way or if it should be stripped.

Actions #7

Updated by Kalle Karlson over 5 years ago

Typo3 should respect the standard in the default case and the standard said that a slash is for hierarchical structure.

Actions #8

Updated by Sebastian Rosskopf over 5 years ago

In my opinion there will be various cases in the future where a slash in a page or record title will be problematic in generating the URL path segments.
Especially when having data records with own path segments, a slash in the record's title will be causing problems.

Let's say my record's title is "Working student / Internship", my URL will look like

my-domain/job-offers/job/working-student-/-internship

which doesn't resolve to valid page structure and doesn't make any sense. There should be options to maybe configure in TCA which characters to be excluded/replaced from speaking URL paths.

Actions #9

Updated by Peter Kraume over 5 years ago

I'd also vote for removing the slash or making it at least configurable.
If I as an editor want to have a hierarchical structure, I nest my pages accordingly. Everything else would only lead to confusion.

Actions #10

Updated by Peter Kraume over 5 years ago

  • Related to Bug #86740: Using slash in slug in extension record throws exception in frontend added
Actions #11

Updated by Peter Kraume over 5 years ago

I think this one is solved via #86740.

Actions #12

Updated by Riccardo De Contardi over 5 years ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (next-patchlevel)

As Peter Kraume pointed out, https://forge.typo3.org/issues/86740 (https://review.typo3.org/58851) added the possibility to set up replacements in the slug configuration; available since TYPO3 9.5.2

Documentation: https://docs.typo3.org/typo3cms/extensions/core/Changelog/9.5.x/Feature-86740-AllowRemovalOfSlashInSlug.html

I close this one, please let me know if this is the wrong decision.

Actions #13

Updated by Sven Juergens about 5 years ago

sorry, I open this bug again. The solution refers to self-written extensions, but how does this relate to the TYPO3 pages? How do I solve this problem for normal pages?
in current TCA für pages -> slug is not an option for that, rigth?

       'slug' => [
            'exclude' => true,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.slug',
            'displayCond' => 'USER:' . \TYPO3\CMS\Core\Compatibility\PseudoSiteTcaDisplayCondition::class . '->isInPseudoSite:pages:false',
            'config' => [
                'type' => 'slug',
                'size' => 50,
                'generatorOptions' => [
                    'fields' => ['title'],
                    'fieldSeparator' => '/',
                    'prefixParentPageSlug' => true
                ],
                'fallbackCharacter' => '-',
                'eval' => 'uniqueInSite',
                'default' => ''
            ]
        ],
Actions #14

Updated by Daniel Reichel almost 5 years ago

  • Related to Bug #88291: Exception thrown if slash in route field of PersistedPatternMapper aspect added
Actions #15

Updated by Stephan Boiting about 4 years ago

That´s my solution for pages im TCA:
$GLOBALS['TCA']['pages']['columns']['slug']['config']['generatorOptions']['replacements'] = ['/' => '-'];

Actions

Also available in: Atom PDF