We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11030
    • 21 Posts
    Hi there,
    I’m struggling to get this Javascript based Countdown Script to work on my Modx website. My client has requested a simple countdown script that count downs the hours, minutes and seconds until a set date.

    The script i am trying to use can be found here:
    http://www.dynamicdrive.com/dynamicindex6/dhtmlcount.htm

    If you look at the page provided, you’ll notice the code comes in two parts. Step 1 should be placed before the </head> tag, and Step 2 should be placed where you want the countdown to appear.

    I figured, i’ll place the step one coding into my custom modx template (obviously before the </head> tag), and then place the step 2 coding into my cms editor via the ’html’ button. However, this method doesn’t seem to work sad.

    I’m curious as to how i’ll get this to work, or if anyone knows of an addon aka ’Extra’ of ModX that will allow me to have a live countdown feature?.

    Thanks for your time.
      • 22840
      • 1,572 Posts
      try adding the code into a chunk then call the chunk in the document, the editor has a habit of cleaning up the code and this could be the issue.
        • 11030
        • 21 Posts
        thanks for the quick reply, but sorry no success sad

        It’s odd, the code works fine in a basic html document, but not with the cms. Personaly, i thought the chuck would have solved it sad
          • 4172
          • 5,888 Posts
          I have two textarea-TVs in my templates. One in head called [*head*] and one before the normal content called [*beforecontent*]

          Copy/Pasted the given code in these TVs. Worked perfectly without problems.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 11030
            • 21 Posts
            I’m kinda new to TV’s but here it goes...

            Okay, so i’ve created two textarea-tv’s, one in the head section called [*head*], with the default value containing the ’head’ code.

            The second textarea-tv is called [*jscontent*] and is placed before the modx tag [content]. The [*jscontent*] contains the second part of the coding and also determines where the countdown application shuold be displayed.

            i’m kinda confused, how do i control where the countdown application goes using Tv’s?

            Thanks again for a timely response, much apppricated.

              • 22840
              • 1,572 Posts
              Just add the call to the TV where ever you want it to appear in the template
                • 11030
                • 21 Posts
                Ah its working like a charm!

                Thanks guy, really appricated it!
                  • 22840
                  • 1,572 Posts
                  Glad you got it working, well done grin