We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41085
    • 5 Posts
    Hi!

    I've created a website for my friends band and find mxCalendar very beneficial. I've implemented it into the site and it works great, as long as an event is coming up.

    If there are no events listed, an error of "Warning: array_multisort()" appears wherever the calendar is displayed.

    The website is http://www.duringdecember.co.uk if you want to see it first-hand.

    Can anyone help with this? Thanks!
      • 38878
      • 255 Posts
      See this thread:

      http://forums.modx.com/thread/78337/errors-after-installing-the-latest-version#dis-post-435603


      You can also "bandaid" and take the ghetto approach and add a repeating monthly event with the title of "." . Bottom line is at current you will get this error if the view has no events. Hopefully the new release will come shortly and fix this.

      • yep, see the thread from above as it has the quick fix to the snippet noted.

        sorry for the delay on release 1.1.6-pl, it's got several big enhancements so it's taking some time to test. hope to have released any day now.

        cheers
          Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
          Visit CharlesMx.com for latest news and status updates.
          • 41085
          • 5 Posts
          Thanks for that guys! That fixes the error and 'No Events' is now displayed.

          The only problem now, is that any detailing such as 'Next Gig' on the homepage box is now gone. Is there a chunk I'm missing which I can add these back into?
            • 38878
            • 255 Posts
            Do you have any events in the calendar at all? Looks like it's empty. If you do have events are you "scoping" the list on the homepage in any way? The chunks should be categorized under MXCalendar. Look for anything with the word "list" in it. I think there are 3 that you could modify to customize your output:

            • tplListWrap
            • tplListHeading
            • tplListItem

            I would copy and rename these so they aren't overwritten with a new version. Also, I'm using a custom property set on the snippet to set the default and other settings that make the snippet calls easier. For example my snippet call looks like this:

            [[!mxcalendar@sngMXCal?&displayType=`list` &isLocked=`true`]] 


            Simple but a few settings from the default property set are overwritten with my custom chunks, etc. without having to set them in the snippet call. If you look at the default property set on the mxcalendar snippet you will see what I mean.

            Hope this helps.
              • 41085
              • 5 Posts
              I have no events in the calendar at the moment as the band does not currently have any gig dates. I made the mistake of integrating certain layout aspects directly into the calendar so when 'No Events' was displayed, elements of the layout were replaced by it. So I can work around that.

              One more thing, possibly a nooby question...but where is the 'No Events' text stored? I would like to edit this if possible.

              Thanks for the help!
              • @apocalypticspirit

                Well you have found a bug, no lexicon nor template for change that.... I'll update the next release to have the "no events" result use a specific chunk for easy modifications.

                in the meantime you can use the output modifiers to change the output to another text or chunk as you see fit.

                example to replace with just text:
                [[!mxcalendar:eq=`No Events`:then=`Sorry, we don't have any events yet.`:else=`[[!mxcalendar?&displayType=`list`&ajaxResourceId=`28`&modalView=`true``]]`?&displayType=`list`&ajaxResourceId=`28`&modalView=`true`]]


                example to replace with a chunk of your choosing (yourchunkname = the chunk you want to use):
                [[!mxcalendar:eq=`No Events`:then=`[[$yourchunkname]].`:else=`[[!mxcalendar?&displayType=`list`&ajaxResourceId=`28`&modalView=`true``]]`?&displayType=`list`&ajaxResourceId=`28`&modalView=`true`]]


                Sorry for the headache until the next release.

                Cheers
                  Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                  Visit CharlesMx.com for latest news and status updates.
                  • 41085
                  • 5 Posts
                  Thanks for that Charles. I have had success on the dedicated gig page, however upon placing that code in the 'Next Gig' box on the front page the site behaves strange. Like it stops rendering the rest of the webpage upon reaching the mxCalendar block.

                  If you can't think of anything that may be causing this then I'll just leave it with the stock text until next release. Thanks for the help.
                  • Yes, sorry there was an extra tick mark in the else statement after true in the modalView parameter; give this one a go.

                    [[!mxcalendar:eq=`No Events`:then=`[[$yourchunkname]].`:else=`[[!mxcalendar?&displayType=`list`&ajaxResourceId=`28`&modalView=`true`]]`?&


                    Cheers
                      Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                      Visit CharlesMx.com for latest news and status updates.
                      • 41085
                      • 5 Posts
                      It seems to be doing the same thing I'm afraid. This is the code I'm attempting to use and is fine without trying to change the text:
                      [[!mxcalendar? &displayType=`list` &sort=`startdate` &dir=`ASC` &elEndDate=`+52 weeks` &tplListWrap=`DDFPtplListWrap` &tplListHeading=`DDFPtplListHeading` &tplListItem=`DDFPtplListItem` &eventListlimit=`1`]]

                      I've tried using the code you posted without adding what I need but that does the same thing.

                      Thanks for the help Charles, but don't worry about it. I'll wait until the next release with the easy changing. Keep up the good work!