jacekkowalewski

Domain based URL's don't influence the backend generated URL's

Recommended Posts

Posted (edited)

Hello all. At first I would like to thank ryan for the answer in this post:

https://processwire.com/talk/topic/4281-language-switching-using-multiple-domains/

However, I found out that there are some details missing.

After setting user language based on subdomain everything runs smoothly (frontend). But there are some little problems on backend:

  1. Edit page -> settings -> name: Below languages there are links. They obviously don't work. They are generated using the page name (I suppose), but should be generated using page full URL. Than we should be able to make a hook that override page full URL (remove language name from path, and prepend it as subdomain).
  2. This problem occurs in many more places in backend (preview page, many other links)

So the idea should be:

  1. On backend, ALWAYS use predefined methods to get page full url (everywhere where links are).
  2. When trying to implement multilingual sites based on subdomains, overwrite page full url method as You wish
  3. When creating language switcher, or everything else, use page full url method.

In other words: every URL in the world should be generated using page full url method. If You wish to change any URL based on subdomains or Your own ideas, just hook to this method. This seems realle reasonable, does it?

What do You think about it? Or maybe I'm doing something wrong? Thanks a lot for Your support and help.

PS. I'm new here, however I love ProcessWire. I'm testing it for few days now, and WOW, I'm impressed. This is my dream coming true!

Edited by jacekkowalewski

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.