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
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?
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
TBH, I suck at Ajax and JS in general so, hopefully, someone else will chime in.
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..
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.