Does anyone know how to get two countdowns on the same page without problems?
I have been looking around and this seems to be the only successful attempt to achieve this, Can we have 2 countdown timers on the same page? if anyone could let me know how I could reproduce this effect with more countdowns I would really appreciate it!
Hi @Aron_Matthie one of solution will be set in CMS your deadline or release date as DATE and in code you have found just replace hardcoded “deadline” value with value of this CMS field.
Do you have any advice on how I could change the text “NaNd NaNh NaNm NaNs” (that is displayed when no date is entered) to "NOT SET." I’ve tried adding a text block with conditional visibility but it seems the countdown overwrites anything inside the “countdown-holder”
Hi @Aron_Matthie I have set this example based on suggestion that event date will be set in CMS and shown immediately. Now you are saying that you want to also publish events without day be set and show eg. “Coming Soon”. It will need a bit different approach and more conditions need to be set, like if(!day) or it it can be done with adding custom attributes based on some condition etc. Im now busy but I probably may look on this in few days.
If you have any further questions you can PM me and we can talk about how exactly you have set your events.
Thanks for directing me here. I have tried to follow along but I just can’t figure this out. In your read only site your countdown holder appears to be empty.
Also in the attached code I couldn’t find any reference to “deadline”
I have tried to get it working on this test site of mine.
H i @stevenworrell85 I have now shortly looked on you project. You can’t just copy paste code and thing that will magically work. As you can see I’ve named collection item event-item that I’m grabbing with javascript. Please take your time to study a bit more this code to get understanding how and what.
When you will get hard time with JS just reach me here on forum.
PS: you do not need second script as it is conversion of date into Czech so day and month names are in Czech language. But I have make changes that is not showing now correctly and like I have mentioned you do not need this script as have nothing to do with timers.
Hi @stevenworrell85 I had now (after dinner) customised code slightly as you have for each time unit different field that will make code a bit more complex because of need to handle how to display text that will show note expired or coming soon and hide timer. In my first example it is sorted as I use only one element to hold message or time.
I have only add some HTML elements to be similar to yours and tweak code a bit . It is not optimal as can be simplified but at least will give you an idea. I have kept original timer to be visible so it is a bit messy but important is code.
Thanks for your help, it’s greatly appreciated. I am not very (at all) familiar with code unfortunately so it takes me a bit longer than most people to figure this stuff out but I will keep trying and I usually manage to get there.