We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15718
    • 2 Posts
    Ok... it’s my second day testing out MODx. I’ve recently tried a bunch of other CMSs and I want to stick with this one although it might be over my head.

    I’m a designer and not much of a programmer so this question might sound very basic to some. I want to add a schedule/tour date listing similar to the idea of the "Upcoming Shows" section on mySpace music pages. Example: http://www.myspace.com/elliottbrood

    I tried making a Template Variable with the "Data Grid" widget but, admittedly, I didn’t really know what I was doing. This was the outcome: http://www.kevenlupien.com/modx/index.php?id=3

    I don’t know if I should be using Ditto or what. Can someone explain from step 1 how to go about adding and editing a schedule listing like this? The help would be much appreciated.

    Thanks.
      • 3749
      • 24,544 Posts
      There are a number of ways to do what you want. Probably the most basic is to do this:

      1. Create a template that has all the stuff you want to show on every page that shows a single event and put [[*content*]] where you want the specific info for that event to show.
      2. Create a new document, designate it as a container called "events", and leave it empty.
      3. Create each event as a new document under that "events" page one by right-clicking on the "events" document in the tree and selecting "Create document here." Make sure it’s published and set to show in the menu. Put the specific info for that event in the content window and save it.
      4. On your home page, put this:
      [!Ditto?startID=`77` &tpl=`MyEventChunk` &extenders=`summary` &debug=`0`!] 
      ( replace 77 with the document ID of the "events" container document).

      5. Create a chunk called MyEventChunk. It will look something like this:

      <div class="ditto_summaryPost">
            <h3>[+title+]</h3>
            <div class="ditto_summary">[+summary+]</div>
      </div>


      The above will just show what’s in the title and summary fields of all the single-event documents but it will give you the idea.

      That should get you started. You’ll want to add some TV’s to the single-event template for Date, location, times, etc. Then you can alter the event chunk to display each event and style them with .CSS so they’ll show up the way you want them to.

      See the site in my sig for some general info on how MODx works (especially templates and snippets) and look here for more info on Ditto:

      http://wiki.modxcms.com/index.php/Ditto

      I hope this makes sense.

      Bob







        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
        • 15718
        • 2 Posts
        Thanks Bob.

        I think I see how that would work but it’s actually more content than what I need. I just need the schedule listings table and not the info pages (my fault, I didn’t realize the MySpace schedule linked to more info).

        Here’s a static example of what the intended finished page should look like: http://kevenlupien.com/modx/schedule.php

        The client would be updating the schedule himself so it would be nice if there was a simple format to add an event and insert the info. The Stash CMS had a great way for adding events shown here: http://www.nicestash.com/tour.php (scroll down to "tour dates edit page"). Can a multi-field input like that be done in MODx?
          • 36582
          • 463 Posts
          This is similar to a post I made the other day. I think there is a shortfall in Ditto and even Wayfinder. They are fantastic tools and they can be manipulated and even combined to produce the result you want especially with the use of TVs. But there is a gap somewhere in between the 2 tools. There doesn’t seem to be a way that I can find (in MODx) of listing multiples of ’products’ (by products I mean anything that can be listed - events etc) without having to create a doc for each product/event. It may be logical to have one doc per event/product but it is overkill in some circumstances when all that is really required is a list of descriptions or maybe a price list to be outputted in a ’chooseable’ order.

          I for one would be grateful of any suggestions or to anyone putting me straight here.
            Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
            • 29774
            • 386 Posts
            @chrisandy

            The powerful Drupal concept of ’nodes’ is one that I would like to see more developed in MODx, so that documents in the site tree can represent any kind of resource; MODx already has easier to use equivalents to Drupal’s CCK (TVs) and Views (Ditto), and the doument tree is a superior representation of web site structure in my view, especially for non-techy clients who actually have to manage content on a daily basis. And it would be great if this as scalable as Drupal’s solution (>5,000 documents/nodes), and included more flexible caching/throttling functionality.
              Snippets: GoogleMap | FileDetails | Related Plugin: SSL
              • 3749
              • 24,544 Posts
              Quote from: chrisandy at Feb 24, 2008, 05:31 AM

              This is similar to a post I made the other day. I think there is a shortfall in Ditto and even Wayfinder. They are fantastic tools and they can be manipulated and even combined to produce the result you want especially with the use of TVs. But there is a gap somewhere in between the 2 tools. There doesn’t seem to be a way that I can find (in MODx) of listing multiples of ’products’ (by products I mean anything that can be listed - events etc) without having to create a doc for each product/event. It may be logical to have one doc per event/product but it is overkill in some circumstances when all that is really required is a list of descriptions or maybe a price list to be outputted in a ’chooseable’ order.

              I for one would be grateful of any suggestions or to anyone putting me straight here.

              Are you thinking of putting the data in a single document or in the DB?

              If you want things in a single document, you can look at the code of EZfaq to see one way to do it. I was thinking the other day about creating a generic version that would allow you to pick the delimiters and have a variable number of columns.

              If the data will be in the DB, I think there are several MODx tools that will create a table for you (the DataGrid widget is one: http://modxcms.com/datagrid-widget.html) and I think it would be fairly easy to do yourself in a snippet using the DBAPI.

              Bob
                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
                • 36582
                • 463 Posts
                Thanks Bob,

                I was thinking of using a doc rather than db insertion.

                I like the look of EZfaq though - well done, I can always understand stuff much easier by looking at an example rather than reading how to do it. I think if you expanded that resource it would be very popular.

                I struggle to understand widgets a bit being a designer and with no db background!

                Thanks for your help
                  Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
                  • 3749
                  • 24,544 Posts
                  Quote from: chrisandy at Feb 26, 2008, 03:42 AM


                  I was thinking of using a doc rather than db insertion.

                  I like the look of EZfaq though - well done, I can always understand stuff much easier by looking at an example rather than reading how to do it. I think if you expanded that resource it would be very popular.
                  Thanks,

                  I can see several ways to approach making a generic snippet. My biggest problem, honestly, is that I can’t think of a decent name for it. smiley

                  I think you could see how to modify EZfaq to do what you want. You just need another demlimiter and another foreach loop for each new column. You can change the delimiters from Q: and A: to #product#, #description#,#price#, or whatever you want.

                  Bob
                    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