diff options
Diffstat (limited to 'timelinejs_json_event.tpl.php')
-rw-r--r-- | timelinejs_json_event.tpl.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/timelinejs_json_event.tpl.php b/timelinejs_json_event.tpl.php index a76f806..575017e 100644 --- a/timelinejs_json_event.tpl.php +++ b/timelinejs_json_event.tpl.php @@ -1,11 +1,21 @@ { - "startDate":"<?php print strftime('%Y,%m,%d,', strtotime($event->field_data['und']['0']['value'])); ?>", + "startDate":"<?php print strftime('%Y,%m,%d,', strtotime($event->field_data['und'][0]['value'])); ?>", "headline":"<?php print $event->title; ?>", - "text":"<?php print $event->body['und']['0']['value']; ?>", + "text":"<?php print $event->body['und'][0]['value']; ?>", "asset": { - "media":"<?php // TODO: print $event->media; ?>", +<?php if (!empty($event->field_embed)) { ?> + "media":"<?php print file_create_url($event->field_embed['und'][0]['uri']); ?>", "credit":"", "caption":"" +<?php } else if (!empty($event->field_image)) { ?> + "media":"<?php print file_create_url($event->field_image['und'][0]['uri']); ?>", + "credit":"", + "caption":"" +<?php } else { ?> + "media":"", + "credit":"", + "caption":"" +<?php } ?> } } |