Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add url_code to res_lang that overrides the locale code when used in URL... #3965

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
7 participants
@88kbbq
Copy link

commented Dec 1, 2014

In the Odoo CMS, the locale code is used in the website URL to specify a non-default language. However, when migrating from e-commerce platforms (Magento in my case) that use a store-view/subfolder type URL convention, this change would allow more control over URL customizations and preserve original URLs rather than forcing rewrites and/or redirects.

This patch allows the webmaster to override the locale code with a custom "url_code" if present, which adds a subfolder-type alias as a "url_code" in Odoo website URLs.

@mart-e

This comment has been minimized.

Copy link
Contributor

commented Dec 1, 2014

Hello,

Thanks for the patch but we can not accept this in a stable version, adding a field is not possible in stable version (see wiki).

I am not against the feature to merge in master instead (could be nice to have /fr instead of /fr_FR in the URL) but we need to make sure we are not breaking anything (like places where we assume we have the format aa_BB).
Maybe @JKE-be can take a look.

@mart-e

This comment has been minimized.

Copy link
Contributor

commented Dec 1, 2014

Hmm actually, after more testing, that does not work.
If you change the url code, you lose every existing translation (not matching the code) and you can not add new terms (no matching with known languages).

After discussing with @JKE-be, it's more complicated that it seems. All the logic is based on the url so changing the code will not work.
Maybe look at an alias system or something but this will require more change that what you are doing.

I am closing this for now but if you have another solution, don't hesitate to create a new pull request for master.
Regards

@mart-e mart-e closed this Dec 1, 2014

@88kbbq

This comment has been minimized.

Copy link
Author

commented Dec 1, 2014

Yes, I am finding issues as well, but it’s a good start. This custom URL should really be a priority, as Odoo is fast becoming as attractive e-commerce option. However, if business owners are told the SEO consequences in terms of rewrites and redirects, they would likely first consider alternatives. In my consulting experience, some businesses spend thousands upon thousands to rank well organically on search engines, and I think it would be a shame for Odoo to lose out on further adoption due to such a strict URL structure.

Anyway, I’ll be working more on this. I took the quick way but there was a much deeper option I was afraid would break even more. On my site, only the e-commerce module breaks, but all my translations are still visible and active. FYI, I contributed to your Indigogo campaign (twice if you believe it) and really look forward to working with this platform. Sorry for the hasty commit to git, and I’ll read your wiki tomorrow at lunch. My apologies. First time doing that, but I wanted to share. Thanks for your time and I’ll make sure to test much more before doing that again.

Cheers!

Kevin Woolf, President
Baba Kevin's American Barbecue Co., Ltd.
1F., No. 14, Ln. 161, Jilin Rd., Zhongshan Dist.
Taipei, Taiwan 104
Shop: +886-800-887-427
Mobile: +886-988-575-319
www.88k.com.tw

On 2014年12月1日, at 下午6:38, Martin Trigaux notifications@github.com wrote:

Hmm actually, after more testing, that does not work.
If you cnange the url code, you lose every existing translation (not matching the code) and you can not add new terms (no matching with known languages).

After discussing with @JKE-be https://github.com/JKE-be, it's more complicated that it seems. All the logic is based on the url so changing the code will not work.
Maybe look at an alias system or something but this will require more change that what you are doing.

I am closing this for now but if you have another solution, don't hesitate to create a new pull request for master.
Regards


Reply to this email directly or view it on GitHub #3965 (comment).

@eqmiso

This comment has been minimized.

Copy link

commented Dec 15, 2014

Hi,

it's really looking good. I really like your first version for this solution. Btw. for test it's crucial to save that url_code value (in my case "en" and "de") in that table res_lang.

Keep up your great work !

@88kbbq

This comment has been minimized.

Copy link
Author

commented Dec 15, 2014

Unfortunately, it breaks translation. Looks like a lot of Odoo's website functionality depends on URLs, which won't make this web URL rewrite any easier. Wish they thought of this in the beginning, but I got word of plans to implement an alias system that should shorten URLs. The example given was ok, but I need full control over URLs before I can adopt the Odoo CMS/e-commence platform. Keeping my fingers crossed!

Kevin

Sent from my iPhone

On 2014¦~12¤ë15¤é, at 17:37, Michal Sodomka notifications@github.com wrote:

Hi,

it's really looking good. I really like your first version for this solution. Btw. for test it's crucial to save that url_code value (in my case "en" and "de") in that table res_lang.

Keep up your great work !

¡X
Reply to this email directly or view it on GitHub.

@88kbbq

This comment has been minimized.

Copy link
Author

commented Jan 24, 2015

Hi mart-e. Any update on the URL alias system you mentioned before? Odoo front-facing URLs really need to be more friendly. If this hasn't been planned yet, let me know and I'll contribute resources to develop this. I just don't want to work on something that somebody else has already begun working on. It's really the only thing stopping me from moving my entire business to Odoo at this point.

@mart-e

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2015

Hello,

There is no plan right now to change the url system on our side. Not sure exactly what you are trying to do but be careful with translations if you develop something.

@88kbbq

This comment has been minimized.

Copy link
Author

commented Jan 26, 2015

Thanks for the reply, Martin.

The main issue before migrating from Magento/Wordpress installation to Odoo is preserving my current URL structure. Without it, I risk losing organic ranking that I’ve spent years and thousands of dollars to achieve. Server side redirects won’t work because I’ll have to manually write redirects for every new page, blog, forum, and event post.

On the Github comment, you mentioned that you might be interested in creating a URL alias management feature. After thinking about it, I think Odoo needs a URL slug field for every front facing module that shows in the CMS (i.e., blog, forum, event, etc.). Currently, Odoo simply takes the page or article title and tries to form a URL with it. One major problem is that if the title is in a foreign language, like Chinese, the title won’t even show at all—you’ll be left with a single digit number as ../blog-1/1. The locale code URL issue I mentioned on Github is a separate but related problem with the current version, so I plan to address that as well. I understand translation is going to be an issue, but hopefully it can be figured out.

Basically, an admin needs to be able to create a custom URL and various redirects from within Odoo. If your team isn’t planning on adding this functionality, I would like to develop it and offer it as a paid module/customization to cover development costs. Please share any thoughts or concerns and I’ll be sure to incorporate your suggestions into this development. It’s super important for both online business owners and the Odoo platform. If I could understand the philosophy, perhaps I could help in other ways.

Cheers!

Kevin Woolf, President
Baba Kevin's American Barbecue Co., Ltd.
1F., No. 14, Ln. 161, Jilin Rd., Zhongshan Dist.
Taipei, Taiwan 104
Shop: +886-800-887-427
Mobile: +886-988-575-319
www.88k.com.tw

On 2015年1月26日, at 下午4:48, Martin Trigaux notifications@github.com wrote:

Hello,

There is no plan right now to change the url system on our side. Not sure exactly what you are trying to do but be careful with translations if you develop something.


Reply to this email directly or view it on GitHub #3965 (comment).

@mart-e

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2015

Ok I agree with you about the issue on SEO and loss of old url (I though you were still talking about alias for languages).

We are planning to work on something to prevent losing the old urls. As you can guess with the "planning to work" sentence, it's far from ready. Meaning we haven't decided yet exactly how we will do it. Probably will be something that generates redirection rules using regex to get all the traffic from your previous CMS to the new one.
So something will happen, too early to tell exactly how and definitely not in version 8.0 but for version 9.

@lukebranch

This comment has been minimized.

Copy link

commented Mar 16, 2015

I think for migrations from Magento, WooCommerce, etc. for already established sites it is a very important feature to consider.

@jadhavajay

This comment has been minimized.

Copy link

commented Jun 7, 2015

Hi @mart-e ,

Are there any plans for "about alias for languages" in Odoo 9 ?

@88kbbq - did you get any solution on "alias for languages"?

@88kbbq

This comment has been minimized.

Copy link
Author

commented Jun 8, 2015

Did you look over the Github fork here https://github.com/88kbbq/odoo/commit/b93b3ba4902d340e4d39be3f098289754d1875b0 https://github.com/88kbbq/odoo/commit/b93b3ba4902d340e4d39be3f098289754d1875b0
Note that this change will break inline translation.

You could try this module, but I haven’t used it yet.
https://github.com/yelizariev/addons-yelizariev/tree/8.0/website_redirect https://github.com/yelizariev/addons-yelizariev/tree/8.0/website_redirect

I’ve completely abandon the Odoo CMS for the time being. I’ll take a look at v9 when it’s stable, but v8 is just not ready for production. Very poor implementation if I do say so. Functionality is great, but that’s what Adobe Business Catalyst did--just throw out features without considering SEO best practices. Site owners spend thousands of dollars and work for years to achieve their desired organic rankings, and for a new CMS not to respect this is ridiculous. It’s a shame, really.

Do let me know if the redirect module works for languages and custom URLs.

Good luck!

Kevin

On 2015年6月8日, at 上午4:35, Ajay Jadhav notifications@github.com wrote:

Hi @mart-e https://github.com/mart-e ,

Are there any plans for "about alias for languages" in Odoo 9 ?

@88kbbq https://github.com/88kbbq - did you get any solution on "alias for languages"?


Reply to this email directly or view it on GitHub #3965 (comment).

@lukebranch

This comment has been minimized.

Copy link

commented Jun 8, 2015

@88kbbq ,

Yelizariev's module looks good, although i've tried it and it doesn't seem to over-ride Odoo's built-in/hardcoded URL structure from what I can tell. Therefore if you rename /shop to /products for the URL it breaks (ie. it's not over-riding and redirecting /shop to /products in a way that works from what I can tell).

I think it will be a similar situation for inline translation as well, however he may be open to some suggestions on improving the module. I'd recommend opening an issue on his github page to alert him of any issues you run into.

@88kbbq

This comment has been minimized.

Copy link
Author

commented Jun 8, 2015

Thanks Luke. This Odoo CMS URL issue is just too big to tackle. Revamping this is really a job for the Odoo team. I really want to love Odoo, even bought a POSbox, but I’m moving to a Sage solution this year. Odoo is just not production ready.

Kevin

On 2015年6月8日, at 下午1:26, Luke Branch notifications@github.com wrote:

@88kbbq https://github.com/88kbbq ,

Yelizariev's module looks good, although i've tried it and it doesn't seem to over-ride Odoo's built-in/hardcoded URL structure from what I can tell. Therefore if you rename /shop to /products for the URL it breaks (ie. it's not over-riding and redirecting /shop to /products in a way that works from what I can tell).

I think it will be a similar situation for inline translation as well, however he may be open to some suggestions on improving the module. I'd recommend opening an issue on his github page to alert him of any issues you run into.


Reply to this email directly or view it on GitHub #3965 (comment).

@lukebranch

This comment has been minimized.

Copy link

commented Jun 8, 2015

@88kbbq ,

Fair enough. If I ever do find a solution to this issue i'll post back to this issue so that you're pinged in case you're interested.

@JKE-be

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2015

@88kbbq
I understand your needs and that it is not what your are looking for...
But fyi, similar behavior that module 8.0/website_redirect is already implemented in Odoo 8.

image

Of course, is only works if the old url is not matching another route. '/shop' -> '/products' is not possible.

I'm agree that it will be a nice feature to allow to choose the 'final slug' like prestashop...
image

But to be honest, and this I say on my own personal responsibility, I don't think that it is in the list of priority for the v9. And anyway, it will be always prefixed from the 'module' name /shop, /blog, /page, ...
I will discuss about it with project manager...

@jholze

This comment has been minimized.

Copy link

commented Jul 2, 2015

We are working on a small SEO suite to get the Odoo urls much more SEO conform. We will publish everything into then OCA Repo to share it with the community and to get help. We started with the Blog update to get better URLs and to give the possibility to add a custom SEO URL for each blog post. Also the tag routing is a bit crap and produces a lot of double content. A good CMS should have a good url structure !!

@lukebranch

This comment has been minimized.

Copy link

commented Jul 4, 2015

@jholze ,

Thanks for the update, I think it'll be very useful. Please post back on this thread with a link to the repo once you're ready, as i'm sure we'd all be very interested to take a look at what you're building.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.