Hi All,

I am using JS timer with a single date cck field,I have to display the datefield in form of JS count down timer in teaser view's template file(node--view--view_name.tpl.php) instead of printing normal date cck field in a block view.I have tried adding the php code snippet given in read me file in the tpl file,but the timer does not show up at all.Is this the way to achieve this ?Is there any other way to achieve this.Please, need some help here.

Thanks

Comments

pradyumnahpt’s picture

Hi,

There is an update to the issue.I have used the below code in tpl file to display the timer,but,when the page is loaded, it displays pop up window saying "Javascript Timer: Span with class=datetime not found within the timer span".And, the timer is not rendered even when display:block is used in css or using print statement before field value.The field type used is Date ISO.However,the timer is rendered when it is used as field in views or a manual date input is given in tpl file.
Am I missing something here,is there any workaround ?

 print theme('jstimer', array(
  'widget_name' => 'jst_timer',
  'widget_args' => array(
    'datetime' =>  $node->field_expires_on['und'][0]['value']
  )
));

Thanks