We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Hi There,

    I am using ContextGateway to route my sites which are all in their own contexts using subfolders as so:

    domain.com/en/
    domain.com/fr/
    domain.com/es/


    I have updated ClientConfig, to make use of its new multi config settings.
    So I have a system setting with the following:
    clientconfig.context_aware Yes
    


    When I go into 'configurartion' in the manager, I can choose a the setting 'telephone number' and from a dropdown, choose a context. Each one has its own phone number for each site in there, but there is also a fourth context in the list called Global.
    It seems that the Global value is overriding everything else. So it ignores the values for each context, and just uses the Global value.
    I have tested this by removing the value in 'Global' and then the output is empty.

    Any ideas what I am doing wrong?

    Thanks as always!
    Andy

    This question has been answered by tm2000. See the first response.

    • discuss.answer
      • 51020
      • 670 Posts
      Quote from: tm2000 at Jul 17, 2018, 03:37 PM
      Hi There,

      I am using ContextGateway to route my sites which are all in their own contexts using subfolders as so:

      domain.com/en/
      domain.com/fr/
      domain.com/es/


      I have updated ClientConfig, to make use of its new multi config settings.
      So I have a system setting with the following:
      clientconfig.context_aware Yes
      


      When I go into 'configurartion' in the manager, I can choose a the setting 'telephone number' and from a dropdown, choose a context. Each one has its own phone number for each site in there, but there is also a fourth context in the list called Global.
      It seems that the Global value is overriding everything else. So it ignores the values for each context, and just uses the Global value.
      I have tested this by removing the value in 'Global' and then the output is empty.

      Any ideas what I am doing wrong?

      Thanks as always!
      Andy

      UPDATE _ I just read on GitHub that Client Config Context Aware Settings don't support the ContextGateway Extra I'm using - but I managed to find an Extra called Cross Context Settings which is an alternative, and works a treat across my contexts.
      Thought I'd post the update in case anyone else was struggling with this!

      Thanks
      Andy
      • The problem with some gateway plugins is that they fire _after_ ClientConfig runs (OnMODXInit), which means ClientConfig does not know what the context is yet. Many routing plugins run on OnHandleRequest, which ClientConfig previously used as well, but that caused it to not work in processor requests and some other edge cases.

        Usually you can switch out the events for the context router just fine, but it's best to report that to the developers to see if they can address that in an update.
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 51020
          • 670 Posts
          Quote from: markh at Jul 18, 2018, 12:06 PM
          The problem with some gateway plugins is that they fire _after_ ClientConfig runs (OnMODXInit), which means ClientConfig does not know what the context is yet. Many routing plugins run on OnHandleRequest, which ClientConfig previously used as well, but that caused it to not work in processor requests and some other edge cases.

          Usually you can switch out the events for the context router just fine, but it's best to report that to the developers to see if they can address that in an update.

          Cool OK - thanks!