Context aware configuration settings

When you activate this feature in ClientConfig (= the Configuration tab in the top menu), you'll be able to change each setting per context.

To do this, select the context from the new "Choose context" menu on the top right of the Configuration view. Once you switch contexts, you'll see that the Configuration header now includes your context name.

A few important notes on how this works:

  • Your existing configuration settings are now grouped under Global (which is the default if you open the CMP).
  • If you don't touch any of the other contexts, they will automatically inherit the default settings. BUT...
  • If you do change a setting in one of the contexts, all current values from Global will be copied to that context, where they will be separately maintained. This important to note, because this means they no longer inherit any of the Global values. So if you make a change in a setting under Global, it will not be reflected anymore in your custom context.

Eventually all contexts will probably receive their own settings, that's the bottom line.

For developers

ClientConfig sometimes doesn't return the correct config setting on the page. This is most likely a conflict with another plugin that fires on the same system event. If for example you're using a plugin like Xrouting to change contexts dynamically, it sometimes occurs that ClientConfig firest too soon (when the context is still 'web').

You can fix this by changing the plugin priority of OnHandleRequest and OnMODXInit to something higher than 0.

Related issue on Github: https://github.com/modmore/ClientConfig/issues/154