We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3232
    • 380 Posts
    I am working on creating a CMP section that would integrate stripe.com into Modx. I am looking to have a handful of settings (API keys, chunk names, etc.) which I would prefer to be separate from the system settings area. At the same time I would like to stay within suggested developer guidelines/recommendation.

    Is there an easy way to store settings/variables? Looking through the documentation, I didn't see anything related to this when dealing with CMP.

    Thanks,
    Brian
      • 3749
      • 24,544 Posts
      If they will be tied to a particular snippet or plugin, they usually are set as default properties or a property set.

      If you need them across several different bits of code, System Settings are the usual method. You can separate them from other system settings by giving them a namespace, and setting the "area" field.

      Another option is to put them in a custom DB table or a file, but it's usually not worth the trouble.


      ---------------------------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
      MODx info for everyone: http://bobsguides.com/MODx.html
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 33976 ☆ A M B ☆
        • 571 Posts
        Hi,

        If your goal (by separating your settings for the system settings) is to provide your users/admins an friendly way (at least "friendlier than going to the huge pile of system settings) to set/change your settings, nothing prevents you to build a page in your CMP.

        I might not be clear (sorry, English isn't my native language)... so you could check how lossendae did for his Google Analytics CMP. All options you can define in the CMP are also system settings.

        Hope my 2 cents will help
          • 3232
          • 380 Posts
          Thanks BobRay and romain for your replies.

          They would be used across all elements so a property set won't work very well.

          Although I will have a custom database table to map web users with their "customer" account I don't think it would be appropriate to have a separate table for 6 or six settings.

          Using a namespace to separate them in the system settings will be helpful. And I love the idea that I can have a CMP to also set/change these settings to make it easier for the user.

          Thank you both

          -Brian
            • 4080
            • 139 Posts
            I'm looking to do the same sort of thing for simple global settings on a site (e.g., so a client could update their own logo or social media linking settings). I of course first checked out Shaun's tutorial on developing a custom extra at https://bitly.com/gZfm0N and my little brain nearly exploded. After all, that's EVEN beyond the scope of your book, Bob, that I'm currently devouring. Amazingly helpful BTW.

            So... I like the idea of a CMP best but perhaps It could be done in system settings (probably where this sort of thing belongs) and then labeled and filtered using ACLs? Or is there info on the above on how to tie a CMP to custom System Settings?
              • 3232
              • 380 Posts
              Quote from: brianlarson at Apr 22, 2012, 08:45 AM
              I'm looking to do the same sort of thing for simple global settings on a site (e.g., so a client could update their own logo or social media linking settings). I of course first checked out Shaun's tutorial on developing a custom extra at https://bitly.com/gZfm0N and my little brain nearly exploded. After all, that's EVEN beyond the scope of your book, Bob, that I'm currently devouring. Amazingly helpful BTW.

              So... I like the idea of a CMP best but perhaps It could be done in system settings (probably where this sort of thing belongs) and then labeled and filtered using ACLs? Or is there info on the above on how to tie a CMP to custom System Settings?

              I don't know if this would help, but how I normally approach these times of things is through TVs. I create a logo, footer text and other site wide elements as TVs on the homepage. I find that this is makes it easy for the client to update themselves and if needed you can use form customization to hide those TVs from specific user groups. The using the getResourceField snippet I can pull those values in on any page.
                • 3749
                • 24,544 Posts
                Doing it with TVs is definitely much easier, though it takes a toll on page load speeds. System Settings are much faster.

                You can create the System Settings by hand if you don't mind letting the client edit System Settings in the grid (usually not a great idea).

                Remember, too, that a CMP can be regular HTML (there's an example in the book), which is much easier to work with than ExtJS. You can create a standard HTML form with a snippet to process the results and set the System Settings.


                ------------------------------------------------------------------------------------------
                PLEASE, PLEASE specify the version of MODX you are using.
                MODX info for everyone: http://bobsguides.com/modx.html
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 4080
                  • 139 Posts
                  Bob, please accept my apologies for the delayed reply. This is very helpful! Thanks to the other Brian as well—this is how I've been doing it but was interested in other ways. Good thinking regarding the form customization stuff though if there's multiple end users.

                  :)
                    • 42146
                    • 73 Posts
                    Quote from: betoranaldi at Jan 18, 2012, 08:51 PM
                    I am working on creating a CMP section that would integrate stripe.com into Modx. I am looking to have a handful of settings (API keys, chunk names, etc.) which I would prefer to be separate from the system settings area. At the same time I would like to stay within suggested developer guidelines/recommendation.

                    Is there an easy way to store settings/variables? Looking through the documentation, I didn't see anything related to this when dealing with CMP.

                    Thanks,
                    Brian

                    i've been looking at integrate stripe.com into Modx as well, anything working you may want to share? have you liked stripe ? been trying to get it intergrated into the a site, to see how it works compared to getting the subscribeme addon working properly that has issues.
                      • 42146
                      • 73 Posts
                      Quote from: betoranaldi at Jan 18, 2012, 08:51 PM
                      I am working on creating a CMP section that would integrate stripe.com into Modx. I am looking to have a handful of settings (API keys, chunk names, etc.) which I would prefer to be separate from the system settings area. At the same time I would like to stay within suggested developer guidelines/recommendation.

                      Is there an easy way to store settings/variables? Looking through the documentation, I didn't see anything related to this when dealing with CMP.

                      Thanks,
                      Brian

                      i've been looking at integrate stripe.com into Modx as well, anything working you may want to share? have you liked stripe ? been trying to get it intergrated into the a site, to see how it works compared to getting the subscribeme addon working properly that has issues.