Feature #84581

Epic #83796: Site Handling

Create a backend module to create site configurations

Added by Benni Mack about 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
System/Bootstrap/Configuration
Target version:
Start date:
2018-04-03
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Bildschirmfoto 2018-04-06 um 12.50.18.png View (28.7 KB) Steffen Kamper, 2018-04-06 12:51

Bildschirmfoto 2018-04-06 um 12.50.38.png View (6.85 KB) Steffen Kamper, 2018-04-06 12:51


Related issues

Related to TYPO3 Core - Task #68893: Introduce constants for pageNotFound-reasons in TypoScriptFrontendController Closed 2015-08-09
Related to TYPO3 Core - Bug #84651: Feature-84581-SiteHandling.rst has a todo remark Closed 2018-04-06
Related to TYPO3 Core - Bug #84652: Translated page called with L parameter throws exception Closed 2018-04-06
Related to TYPO3 Core - Bug #84661: SiteHandling can't load config on windows Closed 2018-04-08
Related to TYPO3 Core - Task #84662: Cleanup site handling Closed 2018-04-08
Related to TYPO3 Core - Task #84598: SiteHandling: Implement text direction Closed 2018-04-04
Related to TYPO3 Core - Feature #17538: Why not a native lang support ? Closed 2007-08-16

Associated revisions

Revision 0824e6e8 (diff)
Added by Christian Kuhn about 1 year ago

[FEATURE] Introduce Site Handling

TYPO3 is famously known for the "multi-site"
functionality, allowing multiple websites running
within one TYPO3 instance.

However, configuring a multi-site had various downsides,
mostly regarding to domain/entrypoint handling for a site,
and if lots of languages were in place.

Concepts like "absRefPrefix", "baseURL", various language
related TypoScript settings, and the infamous
"L" GET parameter can now be seen obsolete.

Also, handling page-not-found or access-denied errors
have never been easier, as every admin/integrator is able
to configure this.

What TYPO3 calls a "site" is a entrypoint / pagetree,
and contains both configuration values relevant for
Backend and Frontend.

A site configuration has a unique (human-readable)
"site identifier" and the following additional values:

  • Root page ID
    This is a page on the root level (pid=0) or having
    "is_siteroot" checked.

-- This allows to fully identify a pagetree with
an entrypoint without having to guess during "runtime".

  • The definition of all available languages for this
    pagetree, including the default language for this
    specific pagetree.

-- This includes both values for backend-related as
well as information, previously only settable via TypoScript.

This way, it is possible to have a TYPO3 installation
with 20 languages, but only using 5 languages within
one pagetree (site), using 15 different languages in
another site, while also giving meaning for all records
within one site.

A site configuration can be added or edited within the
TYPO3 Backend in a new backend module for admins,
and is then persisted in
"typo3conf/sites/site-identifier/config.yaml".

The configuration format yaml is chosen as it minimizes
the risk of doing hacks, but the concept of a SiteConfiguration
can be adapted / exchanged to be overloaded or found
in various other places in the future.

Adding a site configuration for a project has various
benefits:
- Configuration is in one place, stored in the file system
thus, is deployable.
- Configuration can be done by an integrator/admin without
any programming skills => in one place.
- The necessity to query sys_language is only needed when
configuring a site.
- No need to configure TSconfig options like
"previewDomains" and "defaultLanguageLabel" are gone.
is
- No need to configure any TypoScript conditions, or
even TypoScript settings related to language handling.
- It is possible to configure error handling on a per-site
level, even language-dependant, without having to
code or configure anything.

However, if no site is configured for a pagetree, the
previous behaviour is still in place, allowing to migrate
slowly to the sites handling, as some key functionality like
URL path handling for speaking URLs is not in place yet.

It is important to understand that adding a site
configuration comes with various restrictions:
- "sys_domain" handling is not necessary anymore, as a page
is resolved via the domain+base URL given in the configuration
- Any previously configured TypoScript conditions based
on L parameter do not apply anymore if a site is configured
- This also applies to any config.*language* related TypoScript
setting.
- It is necessary to use a URI with scheme and path to configure
a site, where as previously, TYPO3 would work without a base
URL.
- mod_rewrite or something similar is a requirement for sites
to work properly.

Further improvements not yet implemented:
- Ensure backend modules like Web->Page, Web->View, Web->List
and Web->Info only show records in the configured site languages.
- Enable the possibility to handle "domain entry aliases",
also for multi-server setups with different domain names.
- Ensure the new Site module can handle "read-only" / deployable
site configurations.
- Allow to activate a language for a site to be editable
in the Backend but not be available in the Frontend for
everybody.
- Handling "Storage Folder" on the top level with different
language entries.
- Improve URL generation in frontend to skip sys_domain
resolving.
- TypoScript conditions for [site = my-identifier] and
[siteLanguage = dk].
- Improve proper caching for rootline resolving of pages
without restrictions.
- Improve resolving of siteLanguage from the current request.
- Linking from one site to a page of a different site.
- Centralizing access to sys_language and sys_domain.
- Handle copying/moving of records to a different site
with different languages and language settings.
- Handle configuration change (like deleting a language
in the configuration - what should happen to the
translated records?)

Next up for 9.3:
- Adding "Routers" on top of sites for URL resolving
of pages and records.
- Handle Storage Folders on top level rootline
- Handle Mount Points

New API:
- New Entity classes "Site" and "SiteLanguage" are
resolved as part of a PSR-15 middleware and available
for pages in FE and BE when possible.
- A SiteFinder object is used to query Site and SiteLanguage
objects and used in various places.
- The new PageUriBuilder allows to create links to pages
without any relation to the current request, and
are already in use in Frontend links and Backend preview links.
- A PageErrorHandlerInterface allows to custom error handlers
to be introduced by extensions and configured on any site.

Site handling is considered still "under development"
until TYPO3 9 LTS, and implementation as well as the
configuration format might change in the next sprint
releases, in order to gather feedback on what is missing
in the implementation.

As a site configuration will be mandatory for TYPO3 v10.0,
some changes regarding sys_language and sys_domain will
follow.

Beware:
- Due to the definition of every record of default language
(language=0), it might be possible to switch to locales
for languages and get rid of the language ID.
- sys_domain won't make it any much longer.

Resolves: #84581
Releases: master
Change-Id: Iabeeb6835a98c8f5a71d502379ed63a68dfad6dd
Reviewed-on: https://review.typo3.org/56505
Tested-by: TYPO3com <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

Revision 5a12dc5f (diff)
Added by Simon Gilli about 1 year ago

[BUGFIX] Convert languageId to integer before passing to getLanguageById

ServerRequestInterface->getQueryParams() returns as string value which
has to be converted to an integer before passing it to
Site->getLanguageById().

Resolves: #84652
Related: #84581
Releases: master
Change-Id: Ibfdb2043aa5f6aee1e7e3cf92d752c7f399ef39b
Reviewed-on: https://review.typo3.org/56599
Tested-by: TYPO3com <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Frans Saris <>
Reviewed-by: Simon Gilli <>
Tested-by: Simon Gilli <>
Reviewed-by: Oliver Klee <>
Tested-by: Riccardo De Contardi <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#2 Updated by Susanne Moog about 1 year ago

  • Tracker changed from Task to Feature

#3 Updated by Gerrit Code Review about 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#4 Updated by Gerrit Code Review about 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#5 Updated by Gerrit Code Review about 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#6 Updated by Gerrit Code Review about 1 year ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#7 Updated by Gerrit Code Review about 1 year ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#8 Updated by Gerrit Code Review about 1 year ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#9 Updated by Gerrit Code Review about 1 year ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#10 Updated by Gerrit Code Review about 1 year ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#11 Updated by Gerrit Code Review about 1 year ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#12 Updated by Gerrit Code Review about 1 year ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#13 Updated by Gerrit Code Review about 1 year ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#14 Updated by Gerrit Code Review about 1 year ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#15 Updated by Gerrit Code Review about 1 year ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#16 Updated by Gerrit Code Review about 1 year ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#17 Updated by Gerrit Code Review about 1 year ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#18 Updated by Gerrit Code Review about 1 year ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#19 Updated by Gerrit Code Review about 1 year ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#20 Updated by Gerrit Code Review about 1 year ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#21 Updated by Gerrit Code Review about 1 year ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#22 Updated by Gerrit Code Review about 1 year ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#23 Updated by Riccardo De Contardi about 1 year ago

  • Related to Task #68893: Introduce constants for pageNotFound-reasons in TypoScriptFrontendController added

#24 Updated by Gerrit Code Review about 1 year ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#25 Updated by Gerrit Code Review about 1 year ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#26 Updated by Gerrit Code Review about 1 year ago

Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#27 Updated by Gerrit Code Review about 1 year ago

Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#28 Updated by Gerrit Code Review about 1 year ago

Patch set 29 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#29 Updated by Gerrit Code Review about 1 year ago

Patch set 30 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#30 Updated by Gerrit Code Review about 1 year ago

Patch set 31 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#31 Updated by Gerrit Code Review about 1 year ago

Patch set 32 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#32 Updated by Gerrit Code Review about 1 year ago

Patch set 33 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#33 Updated by Gerrit Code Review about 1 year ago

Patch set 34 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#34 Updated by Gerrit Code Review about 1 year ago

Patch set 35 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#35 Updated by Gerrit Code Review about 1 year ago

Patch set 36 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#36 Updated by Gerrit Code Review about 1 year ago

Patch set 37 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#37 Updated by Gerrit Code Review about 1 year ago

Patch set 38 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#38 Updated by Gerrit Code Review about 1 year ago

Patch set 39 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#39 Updated by Gerrit Code Review about 1 year ago

Patch set 40 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#40 Updated by Gerrit Code Review about 1 year ago

Patch set 41 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#41 Updated by Gerrit Code Review about 1 year ago

Patch set 42 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#42 Updated by Gerrit Code Review about 1 year ago

Patch set 43 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#43 Updated by Gerrit Code Review about 1 year ago

Patch set 44 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#44 Updated by Gerrit Code Review about 1 year ago

Patch set 45 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#45 Updated by Steffen Kamper about 1 year ago

Looks good from testing, though some questions remain.

1. Why do we need a new module group, do we expect more modules there? Imho it also fits to the settings module.
2. How does it interact with the TS config section? Especially with the language settings, linkVars etc
3. Root Page ID select shows wrong page, in my case it shows first subpage of site root. It should show the root page (even if select is disabled) - see screenshot

Beside that, it works as expected, page is generated correct.

#46 Updated by Gerrit Code Review about 1 year ago

Patch set 46 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#47 Updated by Gerrit Code Review about 1 year ago

Patch set 47 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#48 Updated by Gerrit Code Review about 1 year ago

Patch set 48 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#49 Updated by Gerrit Code Review about 1 year ago

Patch set 49 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#50 Updated by Gerrit Code Review about 1 year ago

Patch set 50 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#51 Updated by Gerrit Code Review about 1 year ago

Patch set 51 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#52 Updated by Gerrit Code Review about 1 year ago

Patch set 52 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#53 Updated by Gerrit Code Review about 1 year ago

Patch set 53 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#54 Updated by Gerrit Code Review about 1 year ago

Patch set 54 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#55 Updated by Gerrit Code Review about 1 year ago

Patch set 55 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56505

#56 Updated by Andreas Fernandez about 1 year ago

  • Related to Bug #84651: Feature-84581-SiteHandling.rst has a todo remark added

#57 Updated by Christian Kuhn about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#58 Updated by Riccardo De Contardi about 1 year ago

  • Related to Bug #84652: Translated page called with L parameter throws exception added

#59 Updated by Susanne Moog about 1 year ago

  • Related to Bug #84661: SiteHandling can't load config on windows added

#60 Updated by Susanne Moog about 1 year ago

#61 Updated by Simon Gilli about 1 year ago

  • Related to Task #84598: SiteHandling: Implement text direction added

#62 Updated by Riccardo De Contardi about 1 year ago

#63 Updated by Benni Mack 8 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF