We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    Well, the good news is: I managed to make the dates with events linkable. smiley

    The bad news is... Kalender uses publish and unpublish dates to show the events. So when the page is not published yet or already unpublished, you get a ’page not found’ error. :’(

    Don’t know how to solve this one undecided

    • Can you share your code? I had a very brief flash of an idea, but without seeing the actual code it’s refusing to come out into the clear.
        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
        • 34162
        • 1 Posts
        Hi Susan, thank you for trying to find a solution for this problem. It would be a great addition to this snippet cool

        You can find the code in lines 663 to 671, which I’ve marked with ///

        I was thinking about a way to update the record in the ’site_content’ table changing the value of the ’published’ field into ’1’, but I don’t know if that would be a good idea.
        • Well, to be honest, I’m not happy with using the "pub_date" and "unpub_date" for the event itself; I would prefer to see those used for what they are supposed to be used for, namely when to show and when to stop showing a document. For example, announcing an event of some sort a month before the event, then having it automatically go away the day after the event. If the pub_date/unpub_date were used properly, this could be done a year in advance and then it would automatically come and go in the calender as desired. And this feature can be ignored if that kind of behavior is not needed.

          I’m going to look into using TVs for setting the actual start date/end date of the event. But that’s going to take fully understanding how this works, and rewriting a lot of the core of it.

          In the meantime, I’ll look at ways to force the document to show.
            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
            • 34162
            • 1 Posts
            Thank you for giving it a try.

            I agree that publish and unpublish date should be used for what they are meant for. But it’s the way this snippet works.

            Personally I would prefer using a database. Perhaps, when I have time, I’ll give it a try to create my own calendar snippet rolleyes
              • 6425
              • 23 Posts
              What I ended up doing is always keeping events published (un-published date is empty), except for events that have not come up so they will always link to the event page and not the "not found page". For events that are coming up and have not been published becuase of the date (I also set the unpublish date as the same day and time), to make it so people don’t get redirected to the "not found page", I edited the code below They still get the popup saying what the event is for that date.

              // If chosen make days with events linkable
              if(($links=="1") and ($monthEvent["id"]<>’’) and ($monthEvent["unpub_date"]==0))
              {
              $dd = ’<a href="’.$url.’index.php?id=’.$monthEvent["id"].’">’.$dd.’</a>’;
              $monthEvent["id"]=’’;
              }
              // Display
              echo $dd;
                • 6425
                • 23 Posts
                Or you can do this and only use weblinks to pdfs or other documents with information and then you never have to worry about the link working for a publishing date:

                // If chosen make days with events linkable
                if(($links=="1") and ($monthEvent["id"]<>’’) )
                {
                $dd = ’<a href="’.$monthEvent["content"].’">’.$dd.’</a>’;
                $monthEvent["id"]=’’;
                }
                // Display
                echo $dd;
                • I’m still poking around in this every now and then with the intention of converting the usage of the publish and unpublish dates to startDate and endDate TVs, and leave the publish/unpublish dates to their original purpose.
                    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
                    • 13137
                    • 204 Posts
                    Hello all.

                    This is a great little plug-in, but as someone in a previous post stated, it would be nice if an updated version was posted in the repository instead of having to search the thread for various fixes. But I guess you get what you pay for wink

                    On another note, is it possible to start the week with Monday instead of Sunday?

                    Also, I cant seem to figure out how the language function works. I cant seem to display it in any other lang. and don’t see where it is pulling the info from.

                    Any help would be much appreciated. Regards
                      • 10313
                      • 375 Posts
                      Quote from: islander at May 31, 2007, 08:35 AM
                      it would be nice if an updated version was posted in the repository instead of having to search the thread for various fixes.

                      Hi. Well the current Kalender version is 1_1 and this works fine here for me. I did not have to fix a byte of code to get it running. Okay, one thing: In the snippet code i deleted the output of the overDiv-DIV. The delivered version of overLib adds the DIV when it is missing. That works best with layouts using position: relative. Some friendly programmers are working on the issue to make days with events clickable. That’s great and I am looking forward to it. I am not too firm with modX yet, otherwise I would give it a look too and spend some time on it.

                      Quote from: islander at May 31, 2007, 08:35 AM

                      Also, I cant seem to figure out how the language function works. I cant seem to display it in any other lang. and don’t see where it is pulling the info from.

                      You just need to set the desired language code. I searched for the vocabularies too but after a few minutes I found out that Kalender just uses PHP’s set_locale and uses the strings delivered by date(). I. e. for German just use
                      &lang=`de`
                      (be careful to use backticks instead of single quotes).

                      I hope this helps
                      Martin