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

前端 未结 3 358
我寻月下人不归
我寻月下人不归 2021-01-22 06:34

I have a website with two languages e.g de and en. De is my default language with no path prefix. En, the second language, has /en/ as prefix in the url. Now when I switch to th

相关标签:
3条回答
  • 2021-01-22 07:23

    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;
    
    0 讨论(0)
  • 2021-01-22 07:23

    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.

    0 讨论(0)
  • 2021-01-22 07:25

    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 :)

    0 讨论(0)
提交回复
热议问题