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

    Back from my three week summer hiatus, I have jumped back into ModX Revo with a vengeance.

    One question has me stumped. Being noobish, I am hoping to get some strategic direction on what to do.

    I followed the Coding Pad tutorials and have set up a basic shell site and am now stuck. I had set up a number of test template variables and filled them in with sample data. What I am stuck on, and have not found any tutorials, is how to handle the forms so casual site users can input data from the front end. I do not think of it as comfortable to let users see the back end that I used to input data. So my next thought is that I build some basic front end HTML form fields, place them in a document, use one of the form parsing snippets like FormIt to check the entries, and then write some PHP code to place the data into the SQL database.

    I have been studying the layout of the ModX SQL database and am fairly clear on where things reside. My question: Am I entering a world of hurt here? Is there a bunch of secret background stuff that I am not aware of, being a noob, that when I insert a new set of data into "site_tmplvars" (as it is called in my db) it will cause problems elsewhere?

    The only tutorials I have seen that show front end forms, as opposed to back end manager forms, are the few that show how to develop a contact form that then is emailed. The site ModXRules.com has a tutorial on how to do this in Evolution, including a manual database entry as well. I know I can probably tweak that tutorial’s methods to work in Revolution without too much trouble, as I am beginning to understand the differences between the two versions of ModX.

    My fear is that I will open up a big project that has no hope of ending until I learn every last thing about the internal structure of ModX.

    Essentially, the question comes back to, is there a way to build front end forms that easily can place their entries into the database to be called later? Or is the back end manager configurable and controllable enough, in terms of limiting what users are able to see and modify, that it can be made to resemble a front end page in look and functionality and be called up on the wen site in that way? I imagine if someone has access to the back end, it ought not to be a concern of theirs for instance with which template is being called up to lay out the front end web page.

    Another goal of this searching is that I hope that if ten people want to input their individual data about a business, for instance, that that data can then be aggregated into the official web page (document) for that business, either manually or automatically. You can see that in the case of using the back end, there would thus be 11 documents created, the core document that aggregates and 10 daughter documents that hold some data as input from each user. I would prefer if there were only 1 document and 10 other sets of data that can show up as a document if configured but that otherwise remain as a mere set of meta-data.

    Alternately, since this user input data would be used to populate the official document page, I could create a separate database table to hold all the data I get from the front end forms, then I can use various methods to aggregate it from there.

    Am I off somewhere and thinking about this all wrong?
    Thanks,
      • 8609
      • 607 Posts
      First things first, are you using Evo or Revo? The Coding Pad tuts are for Evolution, not Revolution.

      That said if you’re using Evo you can use ManagerManager to thoroughly customize what your users see in the backend. You can hide a lot of stuff from your users so they can’t see or change system settings, templates, chunks, etc etc. It’s very customizable.

      If you’re using Revo then there are other ways and means, but I’m not conversant enough with Revo to give you an intelligent answer and will let someone else go for it smiley

      I suppose you can create and use forms for this purpose, but for Evo I would just go with ManagerManager.
        • 3749
        • 24,544 Posts
        The MODx Revolution Manager is highly configurable. I think that may be your best route.

        You can also create front-end forms in Revo with the FormIt snippet. Using the results to alter the database is not impossible, but it’s more complicated than customizing the Manager.

          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
          • 24931
          • 20 Posts
          thanks for the responses.

          After I posted the query, it occurred to me to take the blog creation tutorial for Revo and to try to expand it to encompass the scope of what I want to do. The concept is the same, someone creates the original page with a certain number of fields, both standard and TV. Then someone else embellishes the original post/document/page with additional data, which of course can include responses/additions to the whole scope of questions as the original person posted.

          My issue is that I would prefer maximum flexibility rather than taking the easy route of modding the manager but then being limited in what I can add to it or how I can manipulate the data (this limit may be in my imagination). For instance, depending on the TV, I need to be able to have a moderator approve the posting, combine several postings into one master posting, sum people’s postings, append to existing postings, etc. While it seems likely manager can do all this once properly configured, by me building out based on the blogging platform as a skeleton, I gain the extra flexibility, at least in my mind.

          The other issue I have goes back to the idea of limiting how many documents are created. With one master doc for each ’business’ and one doc for each user response, the whole thing becomes unwieldy very quickly with many tens of thousands of documents being generated.

          I will try this method of modding the blog docs first with a few sample fields and see if it achieves what I need. Again, any added advice would help me to figure out the shortest path to what I want to achieve.