DevTomas Posted June 24, 2013 Share Posted June 24, 2013 For example I have 2 languages: English and Russian and want add page News only to English language. When I create page I set title only in English, but when preview page I got 2 same pages in both languages. My question is, how to create page for one language ? Link to comment Share on other sites More sharing options...
ryan Posted June 26, 2013 Share Posted June 26, 2013 There are a few different ways to approach a multi-language website. The answer will depend on what multi-language solution are you using. If you are using the multi-language page names module native to PW 2.3, then you would have checkboxes on your settings tab that indicate whether the language is active or not. However, since you mentioned you have 2 different pages, I'm guessing you are using some other multi-language solution, but not sure which? Link to comment Share on other sites More sharing options...
icietla Posted December 13, 2013 Share Posted December 13, 2013 Hello, I'm new in this forum. First I want to thanks a lot the processwire community and Ryan for this wonderful tool and all these explanations! (sorry if it's a "french english"...) So, about this topic, with the multi-language page name module approach, I know there is a checkbox for each language but not for the default. All is fine when you don't want to translate the initial default language page. I understand that the default language should exist to support the other(s). But how to do when I want to add a new page with only a secondary language enabled ? My project will have most of his pages translated (french for the default language and english) but if my client want to add a specific page only in english is it possible? Thanks for your help. Link to comment Share on other sites More sharing options...
dragan Posted December 13, 2013 Share Posted December 13, 2013 Bienvenu au forum icietla There are probably many workarounds for that scenario. You could create a checkbox inputfield, and check the value in your head or init.php template. If that checkbox is checked, you could do a redirect to the other language. if($page->redirectLang == 1) { $user->language = "en"; $session->redirect($page->url); } (untested) 4 Link to comment Share on other sites More sharing options...
icietla Posted December 13, 2013 Share Posted December 13, 2013 Merci Dragan ! Your solution seems great! Because I don't have a long processwire experience, I did not think about it : how powerful (and simple) it is to add any field in any template we want for any need... I will try it. Thanks a lot. 1 Link to comment Share on other sites More sharing options...
yellowled Posted April 13, 2014 Share Posted April 13, 2014 If you are using the multi-language page names module native to PW 2.3, then you would have checkboxes on your settings tab that indicate whether the language is active or not. I just stumbled upon this catching up on my reading for multi-language sites. For a long-term multi-lang project I'm about to implement, this is pretty much perfect. One of the (many) cases where I stumble upon something implemented in PW, and I just go “Wow, Ryan, that's a brillant solution.” It really gives me a warm, fuzzy feeling that this CMS is being developed the way it makes sense. Just wanted to note that, even if it's way after the fact. Link to comment Share on other sites More sharing options...
Raymond Geerts Posted April 19, 2014 Share Posted April 19, 2014 how powerful (and simple) it is to add any field in any template we want for any need... Ha, nicely described that. this is what i love about processwire, and that 'everything' is a page and can be used for anything Link to comment Share on other sites More sharing options...
Can Posted August 12, 2014 Share Posted August 12, 2014 Bienvenu au forum icietla There are probably many workarounds for that scenario. You could create a checkbox inputfield, and check the value in your head or init.php template. If that checkbox is checked, you could do a redirect to the other language. if($page->redirectLang == 1) { $user->language = "en"; $session->redirect($page->url); } Hey folks, This one is nice dragan, thanks for sharing! Is there a way of disabling language pagenames for some templates? I'm thinking of an image template where i don't want/need different urls. Or of course it would be cool if it where possible to disable not only the additional languages but the default as well. And one more question. Is it somehow possible to have language urls checkbox disabled by default? So I have to activate it myself when I'm going to publish another language version instead of having to uncheck it..? Cheers Link to comment Share on other sites More sharing options...
ptjedi Posted April 6, 2015 Share Posted April 6, 2015 I share the same need as Can and icietla: the hability to disable the main language of any given page in order to exclude it from listings and access. For the time being, it is only possible to disable for non-default languages. 1 Link to comment Share on other sites More sharing options...
m-artin Posted June 24, 2015 Share Posted June 24, 2015 I think I found another simple approach to this topic. Just add a specific word to your page title (only for the default language). Let's say your page is called "Regional Products". You can add the word "french" for example and name it "Regional Products (french)". The french Multi-Language-Title can still be translated to ›Produits régionaux‹, without any additions. Now you are able to filter your listings with the Selectors API. And find all pages which doesn't contain your specific word in the default-language title. !title*='french' If you are using the nice module MarkupSimpleNavigation the options setting looks like this: $options = array( // selector: page-filter for default lang, if word is contained in page-title "selector" => "!title*='french'" ); The result is the specific pages are filtered within the default language and they are still listed for the 'activated' languages under the Settings-Tab. 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