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

    I want a manager-editable database of things which can be displayed in other pages. The things themselves have no need for their own page, but one page could have many of them. How would this best be done?

    For example, I have a Offices, and each office has Contacts, each of which has a name, address, email etc. Contacts need to be easy for a manager to add and edit, so they should be editable right from within the MODx Manager interface.

    Thoughts?

    Thanks!
    --Peter
      • 22980
      • 84 Posts
      Alright, with some more time spent on the project, I have a pretty clear idea of what needs to go down - custom database tables interfacing with the modx manager interface and being used to display web pages. Before I jump to an idea and sink hours in to it, can anyone provide me a reality check?

      Starting with the managermanager code which creates a new tab on a Resource, I’m going to create a tab which can add remove and edit contacts - through ajax requests to the DB.

      I hear that Revolution is (among other things) designed for better manager customizability, and, although I haven’t looked in to it yet, xPDO would be used for things like this. Should I switch to Revolution first?

      Thanks!!!

      PS: are there any snippits/extras that I should know about?

      EDIT: along those lines, I’ve found the options SQLbuddy and dbEdit. Don’t mind me while I disappear back in to my web browser..

      EDIT2: Those won’t do the trick. Can anyone tell me what php file in the manager I should edit in order to modify the edit Resource page?

      How should I handle ajax data submission for the database?
        • 3749
        • 24,544 Posts
        I think this might be just what you need to get you started in the right direction: http://www.sottwell.com/create-module.html.

        Sottwell’s tutorial is for Evolution.

        If you’ve a mind to do it in Revolution, this relates to dealing with the custom DB (though not the UI for it): http://svn.modxcms.com/docs/display/revolution/Using+Custom+Database+Tables+in+your+3rd+Party+Components.

        This is about Custom Manager Pages: http://svn.modxcms.com/docs/display/revolution/Custom+Manager+Pages



          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
          • 22980
          • 84 Posts
          So I successfully made a way to give a document a custom tab with content loaded from an external file, only to blow a huge chunk of time because there was a form on my included page, causing nested forms without my realizing it. The easy solution (seeing as its ajax anyway) is to make a div hold the form elements, but is there a better way, handling the submission through modx? I’m worried jQuery might have issues serializing a div; we’ll see.
          undecided

          PS: the links you sent (speicifally the SOttwell site) were a big help

          Also, for some reason my </input> tags are being eaten (literally, disappearing for no reason!) If anyone can shed light as to why, do let me know..
            • 3749
            • 24,544 Posts
            TBH, I suck at Ajax and JS in general so, hopefully, someone else will chime in.
              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
              • 22980
              • 84 Posts
              Ended up just using a div, which was fine. A shame that serialize needs a form to work, but no worries. I still don’t know why </input> were disappearing, but at any rate they’re invalid html, so probably something somewhere was cleaning for me..
                • 3749
                • 24,544 Posts
                Quote from: pehrlich at Feb 14, 2010, 11:13 PM

                Ended up just using a div, which was fine. A shame that serialize needs a form to work, but no worries. I still don’t know why </input> were disappearing, but at any rate they’re invalid html, so probably something somewhere was cleaning for me..

                You definitely want TinyMCE turned off when working on stuff like this. It may be cleaning things up for you.
                  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