We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17412
    • 270 Posts
    Hi, my question: "Is it viable to use Ditto to list events?"

    I intend to sortBy a TV with a custom date in order to publish dates that exist in the future.

    The reason I choose Ditto over Calx, Kalender or Event Calendar is purely for the listing format. I don’t want to use the grid calendar format but rather a news-listing format.

    Has anyone else used Ditto in this way?


      • 10449
      • 956 Posts
      Yes, that’s perfectly viable. I’ve done things like concert agendas with only TVs + Ditto and it works like a charm.
      Each event is stored in a separate doc, in one folder. I’ve just added TVs for city, club, "more infos URL", date, comments, flyer (jpg) etc. and use two Ditto calls for all: one for past dates, one for future dates. Plus one custom tpl for the listing itself, which is just a chunk with HTML + placeholders.

      Here’s more infos/tips:
      http://ditto.modxcms.com/files/snippet-ditto-php.html
      http://ditto.modxcms.com/tutorials/basic_filtering.html
      http://modxcms.com/forums/index.php/topic,16273.0/topicseen.html
        • 17412
        • 270 Posts
        Ah that’s great news.
        Thanks for your help ganeshXL!

        I’ll get to reading smiley
          • 17686
          • 5 Posts
          Hello lokust,

          did you get the event listing to work. I´ve been looking exactly for the same function as you. Just don´t know how to start with it.

          If possible could you write a short step-by-step how you did it.

          Kenneth
            • 27708 MODX Staff
            • 2,502 Posts
            I am using Ditto for events with a TV called event_date and PHx to filter the items that have no event date. This is very basic and allows for me to have events and news in a single ditto call.

            If you are looking for a more detailed step-by-step, I will write a page for the WIki if you want.

            All the best,

            Jay
              Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Please do. This sounds like something very useful.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 17686
                • 5 Posts
                I agree, please write a short HOWTO so I can get started.


                Kenneth
                  • 17412
                  • 270 Posts
                  Hi Kenneth,

                  Here is what I did:

                  1. Create the Template Variable where the event date will be entered

                  Create a template variable called eg. eventDate

                  Input type: Date
                  Widget: Unixtime

                  Assign this TV to the template you will use for your event items.

                  -----------------------------------------

                  2. Create the Ditto call

                  This is the Ditto call that I use:

                  [[Ditto? &parents=`2` &display=`10` &summarize=`100` &removeChunk=`Comments` &tpl=`ditto_blog` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`0` &tagData=`documentTags` &sortBy=`eventDate` &dateSource=`eventDate` &id=`archive` &dateFormat=`%d %B %Y`]]

                  Note: &sortBy=`eventDate` &dateSource=`eventDate`

                  -----------------------------------------

                  3. Create your event items

                  And assign a date in the eventDate TV. Ditto will be able to sort your events past/present/future.


                  See also this tutorial from Mark Kaplan (Ditto’s creator): http://ditto.modxcms.com/tutorials/sort-by-a-date-tv.html


                  Hope that helps smiley