Jump to content
owzim

Single-language-section on multilang site

Recommended Posts

Hi,

I am trying to install a German-only blog (with Kongondo's Blog Module) on a multi language site, which is making me pull my hair out since I have next to no experience with multilang PW.

The site uses the gateway approach, splitting the url into /en/blahblah and /de/blahblah

English is the default language, so when I post a post, I have those two urls and I have to activate the german version to be even available.

So, I only want /blog/blog-post-title/ without /en/ or /de/ and I don't want the user to have to activate (see checkbox on the screenshot) German version altogether.

How? Thanks!

Screen Shot 2016-07-09 at 01.11.39.png

Share this post


Link to post
Share on other sites

In before better answer, there is a good tip from @horst about how to set a default language from the start.

The thread is interesting too.

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks sinnut, i tried that out but I ran into tons of issues with the installations modules compatibility with pw 2.8.x so unfortunately this is no option.

I am having endless issues with the blog module and multilang, so I'll move the discussion there.

Share this post


Link to post
Share on other sites

I have the same challenge now on a multilang site. Using PW 3.0.42 with the default multi-language setup.

A certain branch of the page tree should act as a kind of microsite, with different templates etc. But only in the default language (English).

As far as I understand I’d “only” have to disable the automatic redirect from domain.com/microsite to domain.com/en/microsite – which is obviously a default feature of the multi-language setup – for the specific branch. I guess this feature is hidden somewhere in the LanguageSupport core module. So it should be hookable (since pretty much everything in PW is hookable).

Anyone has a deeper understanding of the LanguageSupport core module and can provide a hint?

Share this post


Link to post
Share on other sites

Maybe this module by Adrian is somehow relative to this topic

 

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, Zeka said:

Maybe this module by Adrian is somehow relative to this topic

Currently that module is only designed for removing the multi-language inputs from the backend admin by setting the noLang template option on the fly. I don't have automatic redirection (like @Michael van Laar describes) on the front-end, so I never added front-end support, but if that setting is checked on the front-end as well, then I'd be happy to add support for it.

 

 

Share this post


Link to post
Share on other sites
On 19.1.2017 at 1:47 PM, Michael van Laar said:

As far as I understand I’d “only” have to disable the automatic redirect from domain.com/microsite to domain.com/en/microsite – which is obviously a default feature of the multi-language setup – for the specific branch.

I took a few minutes to investigate. As far as I understand, the variable $redirectURL in /wire/modulesProcessProcessPageView.module is used to perform the above mentioned redirect (as well as any redirect which is necessary when handling URLs).

In this case the varibale $redirectURL is set in /wire/modules/LanguageSupport/LanguageSupportPageNames.module, between line 202 and line 317.

If it’s possible at all to eliminate the default language’s name segment from the URLs of pages of a specific tree branch – which is something @ryan or someone knowing the core really well could tell –, writing a hook that alters $redirectURL before it is used would be the direction I’d think of. But since I still haven’t had much time to learn more about the different hooks, this is only a guess.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Andreas Augustin
      hello,
      I want to build a custom validator on my multilang site.
      I added following hook, but I get only the default language value. How can I access the values of the other languages?
       
       
      public function init() { $this->addHookAfter("InputfieldTextarea::processInput", $this, "validateShortlinks"); } public function validateShortlinks($event) { $field = $event->object; $text = $field->value; // only the default language, how can I get the other languages? }  
    • By Andreas Augustin
      Hi,
      How can I use the __('Some Words to Translate') feature in Processwire Smarty Templates like {__('Some Words to Translate in Smarty')}?
       
×
×
  • Create New...