#86216Allow empty slug for root pages and sysfolders
Description
Consider following page tree (TYPO3 CMS 9.4 composer):
TYPO3 [0]
+ Root [1]
+ General Storage [2]
+ News [3]
+ ...
+ Websites [4]
+ Website 1 [5]
+ Folder [6]
+ Imprint [7]
+ Website 2 [8]
- Page Root [1] has a domain record ‘typo3.example.org’ to provide one easy entry point for the CMS instance. It’s an external link to ‘/typo3’.
- News records are stored in Root > General Storage > News [3] (e.g. no need for news authors to see ‘Websites’)
- Pages Website 1 [5] and Website 2 [8] have both
is_siteroot=1and a valid site configuration
I’m missing RealURL’s ‘Exclude from Speaking URL’ setting:
Empty slug for root pages
Pages Website 1 [5] and Website 2 [8] can’t have slug=/. Saving slug=/ results e.g. in slug=/1. Recalculating the slug will produce slug=/websites/{pageName}.
As an Integrator/Editor it should be possible to create “base slugs” (slug=/ ) for pages with is_siteroot=1.
Empty slug for sysfolders
To e.g. exclude pages from the main nav menu but include it them in some other menu (e.g. ‘legal links’) and keep a short URL page Imprint [7] is placed inside Folder [6].
As an Integrator/Editor it should be possible to create “empty slugs” (slug=/ ) for sysfolders.
Reviews 1
Related issues 5
- Epic #84728Introduce speaking URLs for pages
- Bug #86456Skip special doktype parent pages in slug generation
- Bug #87452Page Slug generation doesn't take path of parent SysFolders into account
- Bug #90736Wrong slug fields for siteroots (level > 1) in multidomain environment and no possibility to modify them
- Bug #106349Non browsable pages should not be slug candidates
History 24
-
Georg Tiefenbrunn changed Related to #84728 <span data-processor="relativetime" data-value="2018-09-10T17:48:00+00:00" > 09/10/18, 17:48 </span>
-
Georg Ringer commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2018-09-12T12:43:58+00:00" > 09/12/18, 12:43 </span> -
Georg Tiefenbrunn commented <span data-processor="relativetime" data-value="2018-09-14T20:10:13+00:00" > 09/14/18, 20:10 </span>
Georg Ringer wrote:
> You know that you can edit the full slug and change it for the imprint directory to/imprint?Yes. But please consider the following from an editor’s view:
With RealURL’s ‘Exclude from Speaking URL’ setting
- Apply ‘Exclude from Speaking URL’ to Folder [6]
- Put all pages which should be included in main menu inside Website 1 [5]
- Put all pages which should no be included in main menu inside Folder [6]
- All subpages of Folder [6] will be available via
/slugwithout further configuration - All subpages of Folder [6] won’t be included in main menu without further configuration
V9 slugs
- You have to manually edit the
/slugfor all subpages of Folder [6]
-
Georg Tiefenbrunn commented <span data-processor="relativetime" data-value="2018-09-14T20:33:19+00:00" > 09/14/18, 20:33 </span>
Georg Ringer wrote:
> Having empty slugs is a bad idea as it creates other problems like what if you change a sysfolder to a page again and vice versa?TL;DR: Website root pages (
is_siteroot=1) should haveslug=/regardless ofpages.pidThe more important part is slug generation for website root pages (
is_siteroot=1) which are not direct children of TYPO3 [0].One of the key features of TYPO3 is its ability to handle multi site and multi domain instances. With the current slug creation we are forced to place website root pages below TYPO3 [0] (= I found no other way than to place all website root pages below TYPO3 [0]. As soon as they are placed inside a sysfolder the slug of this folder will be added to all page slugs).
My way of implementing multi domain instances which mostly share a lot of non page related stuff as news, events, addresses, etc. is to use the above described structure:
- Put all Websites into a sysfolder (Websites [4]) and assign only one db mount to users which may edit pages/page content.
- Put all non-page related records in a sysfolder (General Storage [2])
Using this method all users have the same page tree (with branches corresponding to their user rights). Admin and power users can quickly close all page related stuff by closing the Websites [4] subfolder.
-
Susanne Moog changed category <span data-processor="relativetime" data-value="2018-09-18T11:01:35+00:00" > 09/18/18, 11:01 </span>
-
Benni Mack changed Related to #86456 <span data-processor="relativetime" data-value="2018-09-30T18:35:23+00:00" > 09/30/18, 18:35 </span>
-
Benni Mack commented <span data-processor="relativetime" data-value="2018-09-30T18:36:10+00:00" > 09/30/18, 18:36 </span>
Hey all,
I hope this one fixes at least one big pain point – namely to exclude sys_folders when creating new subpages.
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2018-09-30T23:48:01+00:00" > 09/30/18, 23:48 </span>
-
Jan Kornblum commented and changed priority
Should haveMust have <span data-processor="relativetime" data-value="2018-10-29T19:56:21+00:00" > 10/29/18, 19:56 </span>Without the possibility to have empty slugs for rootpages in multidomain environments, for me it seems to be impossible to get my just upgraded instance live. In addition, i cannot call a domain itself by http://domain.tld (error page not found), currently it must be called as http://domain.tld/1 (this slug again). I think this is really an important (must have) issue…
-
Georg Tiefenbrunn commented <span data-processor="relativetime" data-value="2018-11-27T13:22:59+00:00" > 11/27/18, 13:22 </span>
My current workaround to prevent ‘/{int}’ slugs on pages not having
pages.pid=0is to use a DataHandler hook ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']) and always set$fieldArray['slug'] = '/'using aprocessDatamap_postProcessFieldArray()function ifpages.is_siteroot=1:Register the hook in ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['myext_pages'] = \Vendor\Myext\Hooks\DataHandler\PagesManipulation::class;Class myext/Classes/Hooks/DataHandler/PagesManipulation.php
<?php declare(strict_types=1); namespace Vendor\Myext\Hooks\DataHandler; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\DataHandling\DataHandler; class PagesManipulation { /** * This method is called by a hook after a record was saved in the BE. * * @param string $status * @param string $table * @param int $id * @param array $fieldArray * @param DataHandler $dataHandler */ public function processDatamap_postProcessFieldArray($status, $table, $id, &$fieldArray, &$dataHandler) { if ('pages' === $table && 'update' === $status) { $record = BackendUtility::getRecord('pages', (int)$id, 'is_siteroot'); if ( true === isset($record['is_siteroot']) && 1 === (int)$record['is_siteroot'] ) { // Set 'slug' to '/' $fieldArray['slug'] = '/'; } } } } -
Heiko Nöthen commented <span data-processor="relativetime" data-value="2018-12-20T16:00:24+00:00" > 12/20/18, 16:00 </span>
We also use nested root-pages (for access rights / bread crumb creation) in TYPO3 before version 9 and we also need to create urls like site.com/ site2.com/. It should be possible to add / as slug for all pages with “is_siteroot=1” regardless if it is a direct child of [0]. Can’t see why this should be a problem. The slug / is unique in every domain.
-
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2019-02-06T14:21:10+00:00" > 02/06/19, 14:21 </span>
Has this one been solved with https://review.typo3.org/#/c/58473/ ?
-
Georg Tiefenbrunn commented <span data-processor="relativetime" data-value="2019-02-07T07:33:51+00:00" > 02/07/19, 07:33 </span>
Riccardo De Contardi wrote:
> Has this one been solved with https://review.typo3.org/#/c/58473/ ?As Benny wrote, only the sysfolder part got fixes.
To-Do: Website root pages (is_siteroot=1) should have slug=/ regardless of pages.pid.
-
Riccardo De Contardi changed status
Needs FeedbackNew <span data-processor="relativetime" data-value="2019-02-07T09:47:41+00:00" > 02/07/19, 09:47 </span> -
Why Fullname commented <span data-processor="relativetime" data-value="2019-08-08T15:49:12+00:00" > 08/08/19, 15:49 </span>
There are more reasons to have a “Exclude from page” option.
Examples
Config:
root -> page1 -> page11 -> page111 (content: dynamic plugin, yaml routeEnhancers)
page111: “Page enabled in menus” -> No (links to page111 are created dynamic)Current:
domain/page1/page11/page111/dynamicRouteEnhance
Goal:
domain/page1/page11/dynamicRouteEnhanceOR
Page acts as container for different pages but the container-page itself has no content or isnt linked in menues.
page: “Page enabled in menus” -> No (links to page111 or subpages are set at content level)
—-
Of course some want the current version, but since you cant set the slug to “/” it comes again to some workaround hooks/tricks.
The page-system is very flexible … thats why i think a “exclude” option is the best case here, you never can predict how people use this tree. Its better to have manuell ways here, since the seo generation should be in the hand of the users.With exclude option you can even generate two routes. A internal (for whatever reasons) and a external seo link. Seo Links != Tree Routes
Having empty slugs is a bad idea as it creates other problems like what if you change a sysfolder to a page again and vice versa?
With exclude option this is not a issue anymore ;-) Since exclude could be exclusiv option for standard pages and seo generation.
-
Jan Kornblum commented <span data-processor="relativetime" data-value="2020-03-11T01:03:49+00:00" > 03/11/20, 01:03 </span>
Any updates here? Got the same problem in 9.5.14 LTS:
- Root [0] -- Start [1] (Just for assigning some global TS) --- Domain A [is_siteroot + site configuration] -> Gets slug "/domaina" --- Domain B [is_siteroos + site configuration] -> Gets slug "/domainb"
-
Jan Kornblum changed Related to #90736 <span data-processor="relativetime" data-value="2020-03-11T17:45:40+00:00" > 03/11/20, 17:45 </span>
-
Jan Kornblum changed Related to #90736 <span data-processor="relativetime" data-value="2020-03-11T17:46:01+00:00" > 03/11/20, 17:46 </span>
-
Jan Kornblum changed
Related to #90736<span data-processor="relativetime" data-value="2020-03-11T17:46:21+00:00" > 03/11/20, 17:46 </span> -
Christian Eßl changed Related to #87452 <span data-processor="relativetime" data-value="2020-03-31T11:07:04+00:00" > 03/31/20, 11:07 </span>
-
Benni Mack changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2023-08-02T13:13:43+00:00" > 08/02/23, 13:13 </span>
-
Riccardo De Contardi changed Related to #106349 <span data-processor="relativetime" data-value="2025-04-08T12:47:02+00:00" > 04/08/25, 12:47 </span>
-
Georg Ringer changed Sprint Focus
On Location Sprint<span data-processor="relativetime" data-value="2026-08-06T15:45:46+00:00" > 08/06/26, 15:45 </span> -
Benni Mack commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-11-19T13:22:24+00:00" > 11/19/26, 13:22 </span>Closing this, as both parts of the original report are solved since 9.5:
Sysfolders in the slug prefix
Fixed with https://review.typo3.org/c/Packages/TYPO3.CMS/+/58473 (“Skip special doktype parent pages in slug generation”): sysfolders and spacers are skipped when the parent prefix is built, so a page below a sysfolder gets
/imprintinstead of/folder/imprint.Site roots not on root level
SlugHelper::generate()returns/for every page withis_siteroot=1, regardless ofpid.- The “recalculate” button did not pass
is_siterootand therefore proposed/websites/{pageName}. This was fixed with #90736 (9.5, 10.4). - Uniqueness is checked per site, so
/on a nested site root does not collide with other site roots or with the page tree root.
“Exclude from speaking URL”
The option discussed in the comments, which would remove arbitrary regular pages from the URL path, is a separate feature request. Please open a new issue for it if it is still needed. I think there are extensions out there already.
You know that you can edit the full slug and change it for the imprint directory to
/imprint?Having empty slugs is a bad idea as it creates other problems like what if you change a sysfolder to a page again and vice versa?
Is it fine to close the issue?