14 Posts
Gene
11 years ago
1
Topic

I'm wanting to know if this already exists or how I might go about creating such a thing...


I want a countdown element in my content which counts down to a state change (such as unpublish).


The best example is a Sales Event - Perhaps one page saying 20% Off These Select Items with a big count down clock - which upon reaching zero unpublishes the page or perhaps triggers a conditional field.

Any ideas?

Get a Book for SEBLOD
14 Posts
Gene
10 years ago
0
Level 1
@Veeco and Vnuchaev...

For my personal use, I can insert a javascript (similar to THIS HERE) into the template doc (using SD Simple Simon).

Then, I go in and change
var target_date = new Date("Aug 15, 2019").getTime();

to something like
var target_date = new Date("<?php echo $cck->renderField('field_name') ?>").getTime();

with "field_name" being the name of the date-type field you plan to use. For me it will be an unpublish date.

I hope this helps others, if I screwed something up, please correct me.
For more on templating, See James Morrell's superb tutorial here - http://www.youtube.com/watch?v=DPMnAbi1-8w


Get a Book for SEBLOD