We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50290
    • 9 Posts
    For a client who organizes sports competitions, I've received two requests which would be fairly straightforward to do but since we've started building his page in MODX, I'd like to find out if there's easy ways in MODX to do the following:

    1. Participation Form.
    Basically there will be a form where a Team Captain can fill out a team's details if they want to participate to a competition/tournament. Simple custom Mail Form this.
    But... prior to arriving at this form page, the client wants to show the visitor a page with all available competitions. A visitor can filter these competitions by some filters such as location.
    Only after clicking on the desired competition would the visitor move to the Mail Form, and this Mail Form would already have the option of the clicked competition pre-selected. Any easy way to go about this in MODX?

    2. Booking Fields
    The client has a couple of fields available. He'd like for users to reserve these fields through the website. It should be simple; just see Field Availability, pick a timeslot, leave some data through Mail Form, and the field should become unavailable to others. Any MODX Extra that can be recommended for this?

    Of course all this should be easy to manage for the client as well - so, easy to add new competitions and easy to manage field availability.

    Thanks so much in advance,

    This question has been answered by claytonk. See the first response.

    • discuss.answer
      • 5430
      • 247 Posts
      1) Yeah, it's not too much trouble to populate form fields via URL parameters. Assuming the mail form is on a separate page, when a user clicks on a competition you can simply pass it to the form page as a URL param (like http://mypage.com/mailform?competition=compname) and use either a quick custom snippet at the top of your form page or something likehttp://rtfm.modx.com/extras/revo/geturlparam to grab the param and inject it into your form field via placeholder. Adding new competitions would simply mean adding a new link with a new URL param.

      2) Not as simple. You'd need to hook the form to a database table and write a snippet or use http://rtfm.modx.com/extras/revo/formit2db as a hook on your form to read/write the specific value you're looking for. The trick here is you'll need to setup an XPDO object class to handle the database interaction. Not difficult, but certainly not uber simple. You might consider using MIGX to create a custom manager page that would allow your client to view and manage field availability. Getting your head around the MIGX process for building CMPs might take a few minutes, but once you have, it's an excellent tool for almost any line-item data point you want to manage via a custom manager page.
        • 50290
        • 9 Posts
        Thanks claytonk, this will get me very far.
        1)For the populating of form-fields with URL parameters, this is the way I was going, thanks for showing me the MODX way.
        2)For the field booking system I'm considering a pre-built system and adapting that. Was just wondering if such a plug-in already existed for MODX, but apparently not. Building a custom system would be too time-consuming for this particular project, but well worth to look into for the future.
          • 4172
          • 5,888 Posts
          adapting a pre-built system sometimes is more work, than building a customized one for example with MIGXdb, if the pre-built one doesn't exactly fit your needs.
          Its not that difficult, if you know which tables, columns and relations you need.

          Might be, I have something flying around, which could partly be reused.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 50290
            • 9 Posts
            Yeah it's in the balance now - if it were an in-house project I'd go figure it all out and do a customized system, learn something along the way. Problem is that it's for a rather.. interesting client with very fickle demands. At some point I'd rather tell him: "This is the tool you're getting, this is what it can do, and that's that."

            If you have anything to help me along the way in the MIGX direction, I might be swayed and obviously eternally grateful.
              • 44922
              • 131 Posts
              Bruno's Migx isn't too difficult if you have a little time. There's the odd YouTube tutorial out there too. You might spend more time in the long run hashing a separate system into Modx... especially if you are wanting to get the system data into the Modx manager for the client to see.