TYPO3 9.5.2 Slug: Multilanguage: Page not found 404 exception, if no translation of page exists

浪子不回头ぞ 提交于 2019-12-01 23:33:59

There is a open bug related to content fallback:

https://forge.typo3.org/issues/86762

Maybe try upgrade to 9.5.3 (Dont know if this is fixed there).

As a workaround: Do you want to remove not translated pages in the english menu?

Then you can set for all pages "Hide page if no translation for current language exists". This checkbox is available for every page under the tab "language".

To do this for all your existing pages:

UPDATE pages SET l18n_cfg = 2

To automaticly set this flag for new created pages: Create a overrides pages.php in your extension.

typo3conf/ext/[YOUR_EXTENSION]/Configuration/TCA/Overrides/pages.php

And add the default value for l18n_cfg

$GLOBALS['TCA']['pages']['columns']['l18n_cfg']['config']['default'] = 2;

Another workaround instead of creating translations for every page is to create static routes. For example:

route: de/english-slug-of-page
type: uri
source: https://yoursite/english-slug-of-page. 

Not very handy solution though. And it has the disadvantage that routing to the English pages will change the selected language (in the example from German to English).

The is still no fix for this issue in TYPO3 9.5.4.

This here should be a comment to the answer from Steffen Mächtel but i dont have the enough reputation -.-.

If you want archive that all pages are hidden(inside menus) when there is no translation, you can set a global setting under Module Settings -> Configure Installation-Wide Options -> [FE][hidePagesIfNotTranslatedByDefault] (< TYPO3 9 you will finde the same setting in the install tool). This way is a bit simpler :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!