We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37825
    • 14 Posts
    Hi guys, Mod X looks great but at the same time it's confusing to me as a developer. I want to be able to create different tables and edit them in Mod X. Like say I want to have a table of my butterflies or any other spurious things. I can't for the life of me work this out and I need to because the site I'm working on currently uses Mod X and they want to keep using it. A real world example, they have users of different types and they also have conversations and files going back and forth. How can I take Mod X which is in a default installation and working like a static site and be able to administrate these different types of data?

    Sorry if I'm unclear... I'm happy to elaborate on anything. My experience comes from building me own CMS's where this kind of thing is all very simple.

    Cheers
      • 31104
      • 108 Posts
      Hi caveman2001 welcome to the forums, you'll learn to love Modx just like the rest of us, specially if you already have experience building you own custom cms'.

      Your question is a little ambiguous but it's clear that you need the basic primer required for working with Modx.

      One perfect place to start could be Mary's codingpad.

      http://codingpad.maryspad.com/2010/08/18/modx-revolution-for-beginners-part-1-introduction


      Cheers, hope it helps.
        • 3749
        • 24,544 Posts
        What version of MODX? If it's Revolution, the is one answer.

        http://bobsguides.com/custom-db-tables.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
          • 37825
          • 14 Posts
          HI Guys,

          It's Revolution...

          I think I might've been ambiguous intentionally because I wanted the answer to be all emcompasing laugh

          Basically I wanted to know what the general rule was for managing your own types of content. Say you had a page that loaded your list of offices with all the phone numbers which came from an address book; or if you had a database table of videos that were shown in a list but also in many other places. What I'm looking to do is be able to go to a page in the manager where it will list all my offices, or videos, or image gallery, or comments etc - all the little elements that go into a site that is more than just a brochure.

          For example, if the site was Facebook for instance, and you were logging into their CMS I'd expect there to be a management page for ad's, people, friendships, apps, comments, links etc.

          I get the impression that the kind of thing I need is Property Sets, but I can't see how to add stuff into the them after I've added the Properties (textfield etc). But maybe this is the wrong place. The docs seem to suggest there's a way of doing it from the Property Sets page but all I can do is create Properties.

          BobRay's post seems like it is related so I will investigate.

          Cheers!
            • 37825
            • 14 Posts
            I'm wondering if I've got the wrong end of the stick....

            http://rtfm.modx.com/display/revolution20/Developing+an+Extra+in+MODX+Revolution#DevelopinganExtrainMODXRevolution-Overview

            Do I need to create those files? Is there any automation? It looks like I could spend days making something appear in the manager? Surely not. Sorry if I'm just being outragously thick.
              • 31104
              • 108 Posts
              You should probably try to get acquainted with modx's basics before you start developing extras.

              Actually there's a good share of Extras already available in System > Package Management > Download Extras.

              And you can download them directly from Modx without any external uploading.

              The rtfm is where you'll find examples and the necessary documentation to get them working.

              http://rtfm.modx.com/display/ADDON/Home

              Hope that helps.

                • 31104
                • 108 Posts
                Check out getResources (an extra) it might help you with the listing or indexing of resources (single pages or content on your site are called resources and can be managed from the tree on the left side of your manager)
                  • 3749
                  • 24,544 Posts
                  There are really two ways to go on this (if I understand your question). This answer mostly applies to MODX revolution.

                  First, You can store your data inside existing MODX objects. There is a modUser object (with an associated modUserProfile object) and there is a Resource (document) object.

                  Properties, BTW, are generally not used for storing significant amounts of data. They are essentially settings, just like System Settings, but with a narrower scope limited to the object they are tied to. User settings are similar, but with the scope limited to the current user.

                  You can add custom fields to the user profile and you can add templates variables (essentially custom fields with some cool rendering options) to resources.

                  The plus side of this methods is that it's relatively easy to design and implement. On the minus side, it's slow, inefficient, and resource intensive for searching and sorting and often awkward to deal with in code. If you're data fits in the standard user profile fields or the standard resource fields, it's a good way to go, especially if you don't have a ton of data objects.

                  The alternative is to use your own custom DB table(s) for the data and use xPDO with them (as per the article I linked to). This takes longer to set up, but is fast and efficient. The down side is that most add-on components won't know your tables exist and you'll have to write custom code to do do searching and display (though that's usually fairly easy once you learn xPDO and a few MODX convenience functions).

                  An alternate version of this second method is to subclass existing MODX objects and add fields to them.
                    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
                    • 37825
                    • 14 Posts
                    Hi Guys,

                    Still working my way round this thing. The documentation seems a bit fluffy and unhelpful. Additionally it turned out the original site was the old version of mod x. Can see how modules will solve my issue of being able to administrate random data, but I have to create the whole code so no time saved there.

                    I can see some good things about mod x but there does seem to be a lot of guff. I must be missing something because clearly more than two people use it. Still, I think it's still better than that peice of crap Drupal.
                      • 37825
                      • 14 Posts
                      Thanks for you replies though!