Feature #87844

Add option to exclude pages from speaking url

Added by Patrick no-lastname-given 7 months ago. Updated 4 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Start date:
2019-03-05
Due date:
% Done:

0%

PHP Version:
7.3
Tags:
Complexity:
Sprint Focus:

Description

Add a option to exclude pages from speaking url (slug), if the page is not the current page.

This feature is necessary for every installation that used realurl in the past.
Links to e.q. landingpages may don't work anymore, if a installation upgrades from 8.7 with realurl to 9.5 with native url handling.

If this feature would be developed, the upgrade wizard "PopulatePageSlugs" should be extended to set the exclude flag on upgrade.


Related issues

Related to TYPO3 Core - Feature #88198: Allow modifications of Slugs by Hooks Closed 2019-04-24

History

#1 Updated by Chris Müller 6 months ago

I think this feature isn't needed, because you can set the slug of the page individually. Take for example the structure:

page-1
page-1 -> subpage-1-1
page-1 -> subpage-1-2 -> subsubpage-1-2-1

You can change your slug e.g. to

/subpage-1-2 instead of /page-1/subpage-1-2

so that page-1 isn't shown in slug for subpage-1-2

Any subsequent pages of subpage-1-2 will also omit page-1, because the slug of the parent page is taken into account when generating a new page under subpage-1-2.

This behaviour is more flexibel than with RealURL, because you can change the complete slug of the page, not only the segment of the page (where you need a possibility to omit a segment).

To make it short, just set the slug of your landing page to the slug you want. That's it.

#2 Updated by Patrick no-lastname-given 6 months ago

For new projects you are absolutly right.
But at least a update solution for projects with used exclude function of realurl over several years on thousands of pages could/should be shipped with 9.5.

#3 Updated by André Schließer 6 months ago

For your example it works!
But if you want subpage-1-1 or subpage-1-2 to be excluded from speaking url, you have to edit every slug on third level.
I think it's bad to say the editor has to care for this.

#4 Updated by Sebastian Krikke 6 months ago

I think even for new projects this is a nice to have feature.
When editiors create new pages and in-between Page segment schould not be shown then the editor has to edit the slug every Time they create a page.
In that regard it would be much easier to simply tell the parent page to not show in a slug, so that editors don't have to bother with the slug.

Another Point is, when you use sluggenerator (for example: 3rd-Party extensions) so rearrange the whole page tree after an upgrade. Here you need to go into every Page to press the refresh button and modify the Slug after. it would be much more comfortable to exclude some specific pages and let the rest autogenerate.

#5 Updated by Benni Mack 5 months ago

  • Target version changed from next-patchlevel to Candidate for patchlevel

#6 Updated by Benni Mack 5 months ago

  • Status changed from New to Needs Feedback

Hey everybody,

it's not possible for us to build such a solution in TYPO3 v9 as it would require to modify the database, which I agreed to not do again after 9.5.5 (due to some hundreds of installations with auto-updates breaking as there was a missing DB field).

So, what I've built was a hook within the Slug Generation which can take care of this:

https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/9.5.x/Feature-88198-TCA-basedSlugModifiersForExtensions.html

So, it should be fairly easy to create an extension to handle all custom specifications needed for an extension author. Hope this helps. If there are well-proven extensions we can look into that for adding this to TYPO3 v10. If there are any extensions available, let me know.

Sorry for the inconvenience on handling it for TYPO3 v9.
Benni.

#7 Updated by Benni Mack 5 months ago

  • Related to Feature #88198: Allow modifications of Slugs by Hooks added

#8 Updated by Patrick no-lastname-given 5 months ago

Thanks for the transparent and professional solution. Looking forward to third party extensions on this feature.

#9 Updated by Christian Hackl 4 months ago

It should be possible because (e.g. a extension with list and detail/show page):
a) Length of the URL for SEO
b) 'detail/show' as detailpage-title is not a (SEO-)category
c) Sometimes you do not know exactly how to name a "detail" page - cause of its content which is a direct child-category from the list-page... belongs to b)
d) IMPORTANT Independent content of the list page (ie anything that does not belongs to the plugin) should not appear on the detail page (SEO - DuplicateContent), in addition, the user must scroll again (Current solution one plugin/page for list and detail view)
e) and so on

Sorry but i don't know how to fix this with your hook @Benni Mack ?

I believe in TYPO3 version 9.4, at least before 9.5.5 it was possible to do something like this in the routeEnhancers in the yaml config ('/../'):

-
routePath: '/../{news_title}'
_controller: 'News :: detail'
_arguments:
news_title: news

That worked great too, can you reinstall that please?

#10 Updated by Patrick no-lastname-given 4 months ago

I tried https://github.com/b13/masi and it worked so far, except from the migration command. I migrated the db fields with db admin. It is currently not available via packagist or ter.

Also available in: Atom PDF