We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18830
    • 161 Posts
    I’m new to MODx and impressed: Great CMS. smiley What I’m missing, is a calendar (don’t want to use an external one).

    On a Textpattern-Website http://www.kiez-ev.de/programm I use this html/microformats-code:

    <dl class="vevent">
    <dt class="dtstart" title="20060710T2030+0100">
    10.
    <span class="month">Jul.</span>
    <span>Monday, 20:30</span>
    </dt>
    <dd class="summary">
    <a href="/film/geheime-leben-der-worte">Das geheime Leben der Worte</a>
    </dd>
    <dd class="location">Kiez Dessau</dd>
    <dd class="description"></dd>
    </dl>  


    Now I wonder, would it be possible doing something like this with MODx?

    My idea: using two template variables "startTime" and "endTime", input type "date". But what about the different output formats I need for the above code? How could I achieve this? And could I use Ditto to sort the dates by "startTime"?
      • 27910
      • 48 Posts
      I’d love to have a calender as well, but got no idea where to start.

      Does anyone else have a calender in their modx sites?
        cPanel :: Fantastico :: RVSkin :: WHM :: ModernBill :: Reseller Hosting :: SSL Certificates :: Domain Registrations :: Affiliate Program :: Blog Hosting :: CMS Hosting :: Forum Hosting :: E-Commerce Hosting
        SoftDux- The Leaders in Software
        Use the coupon: modx to get 20% off our packages
        • 7923
        • 4,213 Posts
        There is atlease DittoCal, Calendar and Simple Event Calendar snippets/modules. Maybe some others around the forum too, but these are what I know. DittoCal is the newest member and I’d suggest to take a look at it.


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 18830
          • 161 Posts
          Thank you, Doze. These Calendars are great (DittoCal I didn’t know), but maybe not suited for me.

          So I want to ask another question: is there any way to set up a Date-TV or to use the pub_date and manipulate the output to extract the year, the month, the hour and so on in one document on different positions and maybe in different formats (like the month by number and by name)?
            • 7923
            • 4,213 Posts
            Quote from: Mazso at Jul 11, 2006, 05:28 PM

            So I want to ask another question: is there any way to set up a Date-TV or to use the pub_date and manipulate the output to extract the year, the month, the hour and so on in one document on different positions and maybe in different formats (like the month by number and by name)?
            Both are possible. You could make a tv what holds the date value or use pub date or created date etc if they suit for you. Then you can make a snippet that returns the date in some custom format and the format would be possible to set as snippet parameter. Then just call that snippet in the needed places with needed format parameter.

            I have modified the "AuthorTime stamp" snippet for some user before, what would be usable for you too, but I didn’t find the post..


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 18830
              • 161 Posts
              Quote from: doze at Jul 11, 2006, 06:44 PM

              I have modified the "AuthorTime stamp" snippet for some user before, what would be usable for you too, but I didn’t find the post..

              Maybe you mean this topic http://modxcms.com/forums/index.php/topic,3588.0.html? Don’t know PHP at all, but I will try to modify this. Thank you so much.
                • 7923
                • 4,213 Posts
                Found the snippet, here. Create that as a new snippet called "GetTime". Then call it like:

                To return year:
                [[GetTime? &usedDate=`pub_date` &dateFormat=`%Y`]]

                To return mont:
                [[GetTime? &usedDate=`pub_date` &dateFormat=`%m`]]

                To return day:
                [[GetTime? &usedDate=`pub_date` &dateFormat=`%d`]]

                To return for example 11.7.2006 22:13
                [[GetTime? &usedDate=`pub_date` &dateFormat=`%d.%m.%Y %H:%M`]]

                You can replace the "pub_date" with any date field from document object. Look for the available date format parameters from php manual: strftime


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 18830
                  • 161 Posts
                  That’s it. Thank you, Doze.