summaryrefslogtreecommitdiff
path: root/timelinejs_json_event.tpl.php
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2012-08-02 17:14:28 -0300
committerSilvio <silvio@socioambiental.org>2012-08-02 17:14:28 -0300
commit53454451a84938723f399a4dd0ced569a5b9fa28 (patch)
tree96780e66f607c2f93b4d475b1695d5e3cb710050 /timelinejs_json_event.tpl.php
parent71bc401f1da3c4220ee1edf21e743e3a9f560d01 (diff)
downloadtimelinejs-53454451a84938723f399a4dd0ced569a5b9fa28.tar.gz
timelinejs-53454451a84938723f399a4dd0ced569a5b9fa28.tar.bz2
Adding embed and image fields into the timeline
Diffstat (limited to 'timelinejs_json_event.tpl.php')
-rw-r--r--timelinejs_json_event.tpl.php16
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 } ?>
}
}