We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hello A client of mine has a strange problem, the calendar works great but they also want a list of the 5 upcoming events on the homepage and a list of the upcoming events next to the main calendar. (very similar to the example on: http://charlesmx.com/mxcalendar-demo.html)

    Unfortunately the list calendar is not working, even if I use the code from the demo.

    I use:

    • MODX Revolution 2.2.0-pl2 (traditional)
    • mxCalendar 1.0.0-pl

    There are no errors in the error log.

    My Call for the main calendar (this works great):
    [[!mxcalendar?
    &tplMonth=`mxCalendarMonth`
    &tplDay=`mxCalendarDay`
    &tplEvent=`mxCalendarEvent`
    &tplDetail=`mxDetail`
    &showCategories=`0`
    &addjq=`0`
    ]]


    The call for the upcoming events list (this is not working):
    [[!mxcalendar?
    &displayType=`list`
    &eventListlimit=`10`
    &isLocked=`true`
    &addjq=`0`
    &tplListItem=`tplListItem`
    &tplListHeading=`tplListHeading`
    &tplListWrap=`tplListWrap`
    &tplCategoryWrap=`tplCategoryWrap`
    &tplCategoryItem=`tplCategoryItem`
    ]]


    I also tried this call (but this does not works either):
    [[!mxcalendar?
    &displayType=`list`
    &isLocked=`true`
    ]] 


    I attached the view I get with the main calendar working but no upcoming events.
    As you can see the title for upcoming events is called but no events are loaded.

    I have chunks for the list calendar items:

    el.itemclean
    <div class="event" >
        <h4><span class="dayofmonth">[[+startdate:date=`%e`]]</span><sup>[[+startdate:date=`%a`]]</sup> <a href="[[+detailURL]]" class="[[+mxcmodalClass]]">[[+title]]</a></h4>
        <div class="date">
            [[+startdate:date=`%l:%M %p`]] - [[+enddate:date=`[[+durDay:notempty=`%b %e `]] %l:%M %p`]] :: [[+durYear:notempty=`[[+durYear]] Years `]][[+durMonth:notempty=`[[+durMonth]] Months `]][[+durDay:notempty=`[[+durDay]] Days `]][[+durHour:notempty=`[[+durHour]] Hours `]][[+durMin:notempty=`[[+durMin]] Minutes `]]
        </div>
    </div>


    el.listheading
    <h3 class="monthheading [[+altmonthheading]]">[[+startdate:date=`%b`]]</h3>


    el.wrap
    <div id="calbodylist" class="list">
        <h6>Upcoming Events</h6>
    	[[+eventList]]
    </div>
      MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
      DESIGNfromWITHIN, MPThemes and Any Screen Size
      Follow me on Twitter | Read my blog | My code on GitHub
      • 32316
      • 387 Posts
      Two things:
      1. perhaps the latest version (1.1.1-pl) would work
      2. this will not be the problem in this case but it is a good habit not to use `true` (which will work, `true`==`1`) because `false` also evaluates as true (for parameters in a snippet call) - having been bitten by this before (following example code!) I now always use `1` and `0`

      Edit:
      I just installed MXCalendar 1.1.1-pl on a 2.2.2 install - used your call for the upcoming events and it all works for me. I would say definitely try to update the calendar version to 1.1.1

      what is a bit odd is the layout of the CMP - some of it is unusable on my laptop screen (13.3 in MacBook Pro), fields are chopped off, I have to view on my big monitor and use a wide window, not very helpful if I'm not at home. [ed. note: whistlemaker last edited this post 11 years, 10 months ago.]