Hi,
I’m new to modx, but have plenty of PHP experience.
I have a problem I’m not quite sure how to tackle.
I would like to allow web users to add structured content to a site, via a front end form with a input field corresponding to each of the members of the structured data type. The site is a Landscape gardening site, and the client needs to add new ’Lanscape Projects’. Each landscape project would have a title, a location, a project manager, and an image.
If I was doing this without modx, I would create a class LandscapeProject with members corresponding to each of the fields. I would create a form and then from the form create an object and store the object in a database table with fields for each member of the object.
To list all the projects I would select all from the database table, iterate over the list, and create an object for each one, and display.
I originally thought I might be able to modify the NewsPublisher snippet, but then I realised Newspublisher was adding to the modx_content table as an actual page, and there are no custom fields specific to Newspublisher, so that was out the window.
My question is how should I go about this task in modx? I’m guessing I could do some of it quite similarly, but would love if someone could give me some specific guidelines.
Thanks,
Subd
Sounds great, thanks for the tips. I’ll try out one or other of these approaches.
This seems to be a common enough problem in terms of sites that I see: a set of specific fields plus image, all to be listed with teaser and possibly paginated, only the set of fields usually differs in number and type for each project.
What would be really ideal is a generic solution that would allow the site developer to specify a set of fields to be uploaded from the front end, and automatically creates the form and template variables and/or specific database tables for the job... But I’ve no idea how something like that might work (It might be little bit like CCK in Drupal, only much simpler)