We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29525
    • 388 Posts
    Georgeous Site! Great calendar.

    I’m not sure I’m following how the calendar works, can you elaborate a bit?

    What is the number for calendar?
    What’s in each-event tpl?
    Is each event a separate document with a TV for each bit of information on that event?
    Is the table generated by the event tpl?

    Thank you!
      www.terrybarthdesign.com
      • 16702 ☆ A M B ☆
      • 536 Posts
      hey,

      great work...
        palma non sine pulvere
        • 36549
        • 572 Posts
        great site. I’d also be interested how you set the calendar up in the backend for client updates...
          www.9thwave.co.uk
             WEB | DESIGN | PRINT
          • 34017
          • 898 Posts
          I’ll try to get in and paste the example code when I can. I’ve got a new calendar I tried to submit to the modx repo the other day I need to release too.
            Chuck the Trukk
            ProWebscape.com :: Nashville-WebDesign.com
            - - - - - - - -
            What are TV's? Here's some info below.
            http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
            http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
            • 29525
            • 388 Posts
            Looking forward to it!

            Thank you!
              www.terrybarthdesign.com
              • 38755
              • 43 Posts
              I would love to see this as well -- calendaring and event registration is something that’s been coming up a lot lately, am doing a site right now who’s central function is based on schedule and class registrations. This is for a science education organization that’s needs to be launched in the next few days (eek! picking up the slack on a late one here, as a favor and the registrations are due to open on the 1st). I’m quickly evaluating all the calendar/event snippets (Easy events, CALx, Kalendar) and will be setting one up with FoxyCart to handle the registrations... it would be a treat to see the calendar used here as a potential option as well wink

              Mind you I’m aware of ’MODx time’ and all the busy schedules, so I’m just crossing my fingers on seeing this presently. I’m looking forward to it regardless, whenever it may become available! grin

              PS. That’s a beautiful site, very nice use of all the technologies.. love the cycle images breaking out of the box
                • 34017
                • 898 Posts
                Alright. There is no way it should have taken this long to explain, but here goes and thanks for the patience.

                Document layout
                Home (1)
                -- Calendar (2)
                Events (3)
                -- January 2009 (4)
                -- -- Event One
                -- -- Event Two
                -- -- Event Three
                -- February 2009 (5)
                -- -- Event One
                -- -- Event Two
                -- -- Event Three
                -- etc...
                


                Content for the Calendar Page
                <h1>[*pagetitle*]</h1>
                
                [[Wayfinder? &startId=`3` &rowTpl=`WF-calendarMonths` ]]
                
                [[Ditto? &parents=`3` &tpl=`Ditto-calendarMonths` &noResults=` `]]
                


                WF-calendarMonths
                <li class="[+wf.linktext+]">
                	<a class="[+wf.classnames+]" href="[*alias*]#[+wf.id+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>
                	[+wf.wrapper+]
                </li>
                

                Ditto-calendarMonths
                <tr class="month-name" > <td colspan="4"><a name="[+id+]"><h3>[+pagetitle+]</h3></a></td> </tr> <tr class="heading"> <th class="date">Date</th> <th class="name"Name</th> <th class="type">Type</th> <th class="location">Location</th> </tr> [[Ditto? &parents=`[+id+]` &tpl=`Ditto-calendarEvents` &noResults=` ` ]]


                Ditto-calendarEvents
                <tr>
                    <td class="date" nowrap>[+Event-Date+]</td>
                    <td class="name">
                         [+phx:if=`[+Event-Link+]`:isnot=``:then=`<a href="[+Event-Link+]" target="_blank">[+pagetitle+]</a>`:else=`[+pagetitle+]`+]
                    </td>
                    <td class="type">[+Event-Type+]</td>
                    <td class="location">[+Event-Location+]</td>
                </tr>
                


                Notes...
                - When you nest snippet calls, you cannot cache both of them. I did not cache either one of them here, because the events change often

                - You can use Ditto orderby to sort the items how you would like
                  Chuck the Trukk
                  ProWebscape.com :: Nashville-WebDesign.com
                  - - - - - - - -
                  What are TV's? Here's some info below.
                  http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                  http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                  • 29525
                  • 388 Posts
                  ChuckTRukk

                  Thank you!

                  Very interesting. I didn’t realize you could put a ditto call inside a Tpl in another ditto call. Very cool. I have no doubt I’ll be able to use this idea in other situations.

                  I sometimes draw little diagrams to help me sort these things out, and remember for next time. (attached) Let me know if it’s not right.

                  Thanks again for posting this.

                  Terry
                    www.terrybarthdesign.com
                    • 38755
                    • 43 Posts
                    Awesome, thanks ChuckTrukk! I somehow missed that you posted this, very glad you did. I was playing with the various calendar snippets but my client has search/filtering desires that aren’t easy to set up with them... this looks like a much better place to start. Basing an events listing off of this and then setting up a jQuery based table/grid plugin for filterin, sorting, and paging should work very nicely.

                    Does anyone have any suggestions for a good way to approach making an event entry get output on a schedule, or as a recurring event? Say a client has an event that happens every mon, wed, fri, or an event that happens every monday between a start and end date. I prefer this approach of using a document hierarchy to manage events, but most of the snippets I’ve seen just work with a date range. For clients with an event that happens every other day for a few months it’s tedious to manually duplicate and edit a document for each date. Any pointers, even just ideas on how to approach would be appreciated! I have a lot to learn about ditto, but maybe some conditions or a call back function that checks some tv values is possible?

                    ChuckTrukk I noticed a bbcode error that left the Ditto-calendarMonths bit mixed in with the WF-calendarMonths code, so I’m quoting a fixed version of your post below in case anyone misses it.

                    Thanks again!

                    Quote from: ChuckTrukk at Mar 30, 2009, 04:22 AM

                    Alright. There is no way it should have taken this long to explain, but here goes and thanks for the patience.

                    Document layout
                    Home (1)
                    -- Calendar (2)
                    Events (3)
                    -- January 2009 (4)
                    -- -- Event One
                    -- -- Event Two
                    -- -- Event Three
                    -- February 2009 (5)
                    -- -- Event One
                    -- -- Event Two
                    -- -- Event Three
                    -- etc...
                    


                    Content for the Calendar Page
                    <h1>[*pagetitle*]</h1>
                    
                    [[Wayfinder? &startId=`3` &rowTpl=`WF-calendarMonths` ]]
                    
                    [[Ditto? &parents=`3` &tpl=`Ditto-calendarMonths` &noResults=` `]]
                    


                    WF-calendarMonths
                    <li class="[+wf.linktext+]">
                    	<a class="[+wf.classnames+]" href="[*alias*]#[+wf.id+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>
                    	[+wf.wrapper+]
                    </li>
                    


                    Ditto-calendarMonths
                    <tr class="month-name" >
                        <td colspan="4"><a name="[+id+]"><h3>[+pagetitle+]</h3></a></td>
                    </tr>
                    <tr class="heading">
                        <th class="date">Date</th>
                        <th class="name"Name</th>
                        <th class="type">Type</th>
                        <th class="location">Location</th>
                    </tr>
                    [[Ditto? &parents=`[+id+]` &tpl=`Ditto-calendarEvents` &noResults=` ` ]]
                    


                    Ditto-calendarEvents
                    <tr>
                        <td class="date" nowrap>[+Event-Date+]</td>
                        <td class="name">
                             [+phx:if=`[+Event-Link+]`:isnot=``:then=`<a href="[+Event-Link+]" target="_blank">[+pagetitle+]</a>`:else=`[+pagetitle+]`+]
                        </td>
                        <td class="type">[+Event-Type+]</td>
                        <td class="location">[+Event-Location+]</td>
                    </tr>
                    


                    Notes...
                    - When you nest snippet calls, you cannot cache both of them. I did not cache either one of them here, because the events change often

                    - You can use Ditto orderby to sort the items how you would like
                      • 34017
                      • 898 Posts
                      Terry,

                      That diagram looks right to me. Seems pretty straight forward.


                      Proto,

                      I have been wanting to do something like you say, but recurring options are a pain. I think it would be a larger project. You could do something like this:

                      - Create a ’recurring’ checkbox with ’mon, tues, wed, thurs, fri, sat, sun’

                      create a snippet to get all of the items into an array. Check each one for recurring, and if there is one, find out the new date and add it into the array.

                      that’s the quickest way i can think of doing it without external tables. Anyone else got ideas?
                        Chuck the Trukk
                        ProWebscape.com :: Nashville-WebDesign.com
                        - - - - - - - -
                        What are TV's? Here's some info below.
                        http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                        http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008