Multilingual single pages (as Page not Found etc)
Permalink
Can there be language-specific single pages in 5.7 Multilingual environment, when there are several content sections in different languages? I have the following problem. Naturally, on my site I have typical global areas with AutoNav and Language Switch, which display pages and languages relative for the current language section only.
Now as Page Not Found is a single page residing in the root of the sitemap, it does not belong to any language section. Therefore, on the Page Not Found page the main menu is empty, because there is no "second level" for AutoNav (see screenshots). Whereas if a user access an URL like /en/non-existing-page (where /en/ is one of my language sections), I would expect Page Not Found to understand that the current language section is "/en/".
I tried copying Page Not Found pages in the Sitemap under my content sections, but it didn't help. Adding language specific paths to app.php like this also didn't help:
So, can anyone shed some light on the proper handling of the situation?
Now as Page Not Found is a single page residing in the root of the sitemap, it does not belong to any language section. Therefore, on the Page Not Found page the main menu is empty, because there is no "second level" for AutoNav (see screenshots). Whereas if a user access an URL like /en/non-existing-page (where /en/ is one of my language sections), I would expect Page Not Found to understand that the current language section is "/en/".
I tried copying Page Not Found pages in the Sitemap under my content sections, but it didn't help. Adding language specific paths to app.php like this also didn't help:
So, can anyone shed some light on the proper handling of the situation?
In version 8 things are even more easier:
- add a stack to the page (or use a global area)
- stacks and global areas can now have a language-specific versions (see the Dashbard page "Stacks & Blocks" > "Stacks & Global Areas")
The page should automatically display the localized version accordingly to the user language.
- add a stack to the page (or use a global area)
- stacks and global areas can now have a language-specific versions (see the Dashbard page "Stacks & Blocks" > "Stacks & Global Areas")
The page should automatically display the localized version accordingly to the user language.
This does not appear to work any more (8.2.0) :(
I've added a stack to the page_not_found.php but only the default version is displayed.
I've added a stack to the page_not_found.php but only the default version is displayed.
I have this problem too (8.2.1)
It does work well in 8.4.x. Nicely done
On the page_not_found.php in the theme I placed language dependent areas (which is probably not the best way, but it works).
This enables an admin to go into edit mode in the page_not_found page and at language specific blocks to the areas.
When a user goes to <url> / <lang> / <something that does not exists>, it will see the error message in the area of the <lang> .
The autonav in a global area is not displayed on the page_not_found single page. Other blocks in global areas are displayed, however usually in the first/initial language even if the <lang> is in the URL.