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

Clientconfig and babel #140

Closed
funkyduke opened this issue Jan 25, 2018 · 7 comments
Closed

Clientconfig and babel #140

funkyduke opened this issue Jan 25, 2018 · 7 comments

Comments

@funkyduke
Copy link

When following documentation about Babel there's a suggestion to make a gateway-plugin with a System event OnHandleRequest. (http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html)

But when you work with clientconfig (version 2) then it's better to choose OnModxInit and give it a priority lower than clientconfig.

@OptimusCrime
Copy link

I do not understand this issue. Is this a question? Modmore has nothing to do with the website you linked to.

@Mark-H
Copy link
Member

Mark-H commented Feb 21, 2018

I asked @funkyduke to report this in case there is something we can do about it. The issue is that clientconfig's new context-aware settings don't work with the recommended babel gateway plugin because of the difference in when they are fired. Switching OnHandleRequest o OnMODXInit in the Babel gateway plugin fixes that.

Was hoping the recommended plugin code was in the RTFM or somewhere though, not sure how to go about getting that particular site updated... no idea who runs that.

@OptimusCrime
Copy link

This guy owns the domain: https://github.com/mikrobi

@joyceDesignbase
Copy link

For me this fix does not work? It looks like it 'sees' the correct amount of contexts but doesn't find the data. I set priority of clientconfig OnMODXInit event to 1 and on gateway plugin switched OnHandleRequest to OnMODXInit and set priority to 0.

Modx 2.6.1

Any suggestions? This is a very cool feature I would love to use on my site with 4 languages!

screen shot 2018-03-14 at 21 13 52

@Mark-H
Copy link
Member

Mark-H commented Mar 14, 2018

@joyceDesignbase That does not look like the same issue reported here. I think you just need to make sure each of your contexts have a name set (and not just a key). If they do all have a name, please open a separate issue.

@joyceDesignbase
Copy link

Thank you, that was it! Sorry I didn't know that you had to set a name.

@Mark-H
Copy link
Member

Mark-H commented Oct 24, 2019

I've slightly changed this in 2.3; it will now automatically run on both OnHandleRequest and OnMODXInit events. A little wasteful, because it really only should have to use one, but then I can finally close this and related issues. ;)

@Mark-H Mark-H closed this as completed Oct 24, 2019
Mark-H added a commit that referenced this issue Oct 24, 2019
…ClientConfig play nicer with various context routing and other solutions that don't use OnMODXInit [#140]
@Mark-H Mark-H pinned this issue Apr 29, 2021
@Mark-H Mark-H unpinned this issue Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants