We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    Another approach...

    I'm assuming you want to put settings in a tab to make them editable by a user who does not have access to the System Settings page. Why not set them up as Context Settings which naturally override the System Settings, and show your user how to update them from the Context panel in the resource tree?

    Much less trickery involved, and much more efficient than syncing TVs.

    You could also look at building a 'Site Settings' CMP containing only the settings you want to allow the user to edit.
      • 37246
      • 128 Posts
      My thought process is: the client is editing a page and wants to update a globally phone number, because they're updating content. Having another tab would make the process seem less. Sending them off to another section for them to get confused by isn't the objective.

      I love the ideas though, going to implement bobs idea tomorrow and see if I can get it to work how I want
        I LOVE MODX! | greyskymedia.com
        • 33968
        • 863 Posts
        I would argue that having 'global' settings alongside 'single resource' settings (ie. Template Variables) might be confusing for your user. But it's your call smiley

        With the TV approach you will have to ensure your plugin synchronises the TV value for every single resource on your site when it changes.

        Otherwise the old value will be present when you edit a different resource, and saving it will reset the System Setting to the old value.
          • 4172
          • 5,888 Posts
          I did a test with MIGXdb, needed to add small additions to get it work with tables, which have another primary-key than 'id' (modx_system_settings uses the field 'key' as primary)
          the changes: (only fields.php and getlist.php)
          https://github.com/Bruno17/MIGX/commit/ad259f0d30f43e317a64aa2f08530646c40023b5

          after that changes, which will also be in the next release, its working with this steps:
          create a namespace:
          mysettings

          create some system-settings:
          key: mysettings.phonenumber
          name: phonenumber
          namespace: mysettings
          area: global

          key: mysettings.faxnumber
          name: faxnumber
          namespace: mysettings
          area: global

          go to components->migx -> tab 'MIGX'

          create a new MIGX-config

          tab Settings:
          name: mysettings
          formCaption: Setting
          uniqueMIGXid: mysettings

          tab Formtabs:
          ->create new tab:
          caption: setting
          ->create new field:
          fieldname: value
          caption: Value

          click: done,done to save and close both windows.

          tab Columns:
          ->create two columns:

          Header:Id - field:id - width:30
          Header:Value - field:value - width:30

          tab ContextMenues:
          check 'update'

          tab migxdbsettings:

          classname: modSystemSetting
          getlistdefaultsort: modSystemSetting.key
          checkResource: no
          where: {"namespace":"mysettings","area":"global"}

          click 'done' to save the configuration

          create a new TV
          name: mysettings
          inputType: migxdb
          configs: mysettings

          assign it to your template(s)


          That's it. Now you should be able to edit your settings, which are in the namespace 'mysettings' and the area 'global', on each of your resources [ed. note: Bruno17 last edited this post 11 years, 8 months ago.]
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 37246
            • 128 Posts
            Bruno... you are my hero. Trying that now!
              I LOVE MODX! | greyskymedia.com
              • 37246
              • 128 Posts
              Gatta be honest with you guys... THIS is why MODx is going to grow... the community who's willing to help without giving it a second thought.

              thanks again
                I LOVE MODX! | greyskymedia.com
                • 4172
                • 5,888 Posts
                be sure to follow this steps, when installing MIGX:

                http://rtfm.modx.com/display/ADDON/MIGX#MIGX-Step2%3ASetuptheMIGXConfiguratorCustomManagerPage%28CMP%29andPackageManager
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 37246
                  • 128 Posts
                  yeah, pebkac... sad
                    I LOVE MODX! | greyskymedia.com