joe_g Posted March 29, 2014 Share Posted March 29, 2014 Hi, I'm doing a bilingual site, but I'm trying to avoid multi-language page names. I don't want the editor to be able to unpublish things per language, and one url is enough per page. If i uninstall multi-language page names, the possibility for language urls disappear (/en/url, /nl/url) – what would be the best way to get these urls without multi-language page names? I'm aware of the old method by having gateway templates and pages (/en and /nl) but this method complicates url segments, so I was hoping there was a more 'core' way of doing it. thanks J Link to comment Share on other sites More sharing options...
Soma Posted March 29, 2014 Share Posted March 29, 2014 But you still use language fields, so 1 page has multiple languages? The "best" way to modify the urls is to hook Page::path and prepend the lang segment. But this will only modify urls you spit out with echo $page->url and PW will not recognize these urls, so you'd have to implement another code to request the right page depending on the new url. Kinda what LanguageSupportPageNames does, so why removing it? Link to comment Share on other sites More sharing options...
joe_g Posted March 29, 2014 Author Share Posted March 29, 2014 Thanks, main reasons are - i don't want the editor to be able to unpublish per language (because it makes language-switching easier when everything is available in all languages, and I rather display a message "text is missing in english" with the un-translated text in dutch than not having a page at all) - Usability-wise: What happens when you want to switch from Dutch to English on a page that doesnt exist in English? (the EN button disappears? EN button is disabled? You get redirected to the home page? You get a message "page missing") Not good usability in any of these options, as far as I can see. - a page is either unpublished or published (for all languages, not per language). Conceptually simple. - the additional complexity for multiple urls, and what they mean, is confusing for the editor. The concept of having to care for the URLs at all is already a barrier. - avoid this issue https://processwire.com/talk/topic/5979-allow-new-pages-to-be-created-from-field-only-creates-in-default-language-when-using-multiple-page-names-module/ I'll look into the hook thing, but I have a feeling I might end up with the language-gateway solution in the end ... : P j Link to comment Share on other sites More sharing options...
joe_g Posted March 30, 2014 Author Share Posted March 30, 2014 Actually, come to think about it, in this case I could skip the language prefixes and rely on a good old session variable instead. j Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now