We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22961
    • 2 Posts
    G’day All

    As I said in the subject line I’m new to MODx having spent a lot of time with Drupal & deciding it’s not up to what I’m trying to do. I’m probably a bit trying to run before I walk in making up for the time I’ve spent with Drupal. I’m also having a very hard time finding the answers I’m seeking here though other sources like the MODx docs & think that may be because differences in terminology between MODx & Drupal. Rather than complete solutions I’m hoping that people here can tell me how doable the things I’m trying to do are with MODx & point me to the right places to learn how to do them.

    So far I’ve downloaded MODx Revolution 2.0.8 & created a couple of try out sites on my home server. In those I’ve been exploring creating resources, templates, chunks & template variables. I’ve also been reading around both in the MODx docs & elsewhere (although most of what I find off the MODx site pertains to Evolution).

    My business is about publishing event programs online & the data involved requires a relational structure of 9 tables (10 if a linking table for a many to many relationship needs to be counted).

    • Can such a structure be created or emulated with MODx? (So far the best I’ve made out is that it would likely be done using TV’s)

    Outside of my business there are 3 types of users who each need to be able to create & edit content. I’d rather not give them access to the management area of my site.

    • Can I give access for content creation & editing through the front side of my site?
    • Can the ability to create various content types be to restricted by user type? (such as events only being created by even organisers & not end users)
    • Can content editing be restricted to the user who created it & site admins?
    • Are the mechanisms I can put on the editing pages so users can link content items (assigning a venue to a performance for example) without the user having to use MODx tags?
    • Can I provide for one user type to take content items created by another user type & make a copy which they own & can do as they like with?

    A lot of my data will need to be served up as serialised data (JSON preferred). Initially that will be one-way & fairly static but as my service is developed I want to provide for live updates & for it to be two-way so end user feedback can be received.

    • Can MODx serve data as JSON? (I’m comfortable with writing templates for the purpose if that’s what it takes)
    • Can JSON be used to update data on a MODx site?

    Finally, a lot of the content on my site will be pay for access so can I create appropriate access restrictions both on the website & for the serialised data?

    I’m certain that everything I want to do can be done if I were to create custom add-ons (what Drupal calls ’modules’, ’extras’ in MODx?) for my MODx installation but then everything I want to do could be done by creating my own custom CMS from scratch too. I’m hoping that [at least most of] what I want to do can be done with what’s built into MODx or with limited use of sound add-ons. Writing my own templates & chunks doesn’t faze me, writing more than pretty elementary PHP does.

    Cheers & TIA, Pedro smiley
      • 33968
      • 863 Posts
      G’day Pedro!

      Welcome to MODx smiley

      I think you would be able to achieve all the above with MODx, although it may require a little custom coding depending on your setup and what you are trying to achieve.

      Here are some suggestions which I’m sure someone else will elaborate on. Note that there are many ways to accomplish things in MODx so you’re not limited to these either.

      My business is about publishing event programs online & the data involved requires a relational structure of 9 tables
      Can such a structure be created or emulated with MODx? (So far the best I’ve made out is that it would likely be done using TV’s)
      Have a look at the existing ChurchEvents package, and also the tutorial on Custom DB tables. Must admit, it will seem like pretty heavy going until you are more familiar with MODx.

      Can I give access for content creation & editing through the front side of my site?
      Can the ability to create various content types be to restricted by user type? (such as events only being created by even organisers & not end users)
      Can content editing be restricted to the user who created it & site admins?
      You can certainly create your own front-end editing pages without letting your editors anywhere near the manager interface. Have a look at NewsPublisher as a starting point.

      You can handle the viewing and editing permissions through Form Customisation.

      Are the mechanisms I can put on the editing pages so users can link content items (assigning a venue to a performance for example) without the user having to use MODx tags?
      You can use TVs with select menus, checkboxes, etc pre-populated by @SELECT queries if you wish. See TV Input Types

      As for JSON, I can’t say I’ve used it but I’ve seen some discussion about it before. I think there is a JSON package floating around out there too.

      Finally, if you haven’t already, have a look here at the Revolution Docs. Particularly the sections on Administering, Developing and Case Studies.

      With a Drupal background you’ll be familiar with CMS but you’ll need to spend a bit of time getting to know how MODx works. A little perseverance and I’m certain you’ll end up pleasantly surprised with the power and flexibility of this system. You’l also soon work out how helpful these forums are too!

      Cheers

      Luke
        • 22961
        • 2 Posts
        Thanks for the welcome & all of your suggestions Luke smiley I currently have every one of the links you gave open. I am pretty sure the Custom DB Table tutorial will set me right for that part of my needs.

        I had seen ChurchEvents & although I initially didn’t think it would serve my needs I shall certainly give it a closer look. Now here’s why I didn’t think it would serve my needs...
        When I say ’event’ I mean something like a festival or corporate conference. A good example is the Woodford Folk Festival where the program runs for 6 days, from 6am to 4am & across 20 stages (plus a few supplementary locations). That’s a complex matrix, a lot more complex than any church events I’ve experienced, & the reason for my 9 tables. It’s also a lot of data to enter item by item in web forms so something very high on my wish list & which I overlooked in my original post is to provide for event organisers to batch import data as [say] CSV files. I’ve seen the WebusersImport package which I’ll be studying as a possible starting point for that. Ultimately I want to provide a web application that event organisers can use for developing their programs.

        Another thing that’s high on my wish list, but neither essential nor urgent, is to provide a calender view of the events listed on my site. That & the web application I want to provide will probably wait until my business has at least one person whose sole job is the website.

        Cheers & thanks again
        Pedro smiley
          • 3749
          • 24,544 Posts
          Here’s another approach to the DB thing that assumes the tables already exist: http://bobsguides.com/custom-db-tables.html.

          You’d have to tweak the schema in between the steps as per the other tutorial because you’ll have related objects.
            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
            • 33968
            • 863 Posts
            That is a little more complex than the typical church event wink
            But should be manageable all the same, as long as you are not expecting it to work out of the box (which I don’t think you are).

            Definitely check out Bob’s suggestion. While you’re there, have a good read through his other tutorials and guides as they are incredibly useful in getting to know your way around MODx!
              • 18373 ☆ A M B ☆
              • 3,141 Posts
              Definitely go for the tutorial on the RTFM or Bob’s site for the events.

              For the rest, I guess most of it will be custom coding, based on existing packages.

              The core already has support for the different permissions needed, and you can use the $modx->hasPermission(’somepermissionkey’)-ish method within your custom panel to check for custom permissions.


              If you want a list of events in JSON format, make a snippet like this..

              $c = $modx->newQuery('myCustomEventClass');
              $c->where(array(
                'active' => 1 //Or whatever fields you're using
              ));
              $c->sort('date','asc');
              
              $events = $modx->getCollection('myCustomEventClass',$c);
              $e = array();
              foreach ($events as $ev) {
                $e[] = $ev->toArray();
              }
              
              return $modx->toJSON($e);

              It may need some error checking (for example to see if there are events to begin with) but it shows how you can use the abstracted object oriented approach after following the tutorial smiley

              There’s no limits on what you can do on the front-end of the site. If you have jQuery sending ajax requests to a snippet and want to use it to create html tables with it, that’s your decision and MODX wont block that smiley
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.