summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--timelinejs.module4
-rw-r--r--timelinejs_json_event.tpl.php4
2 files changed, 3 insertions, 5 deletions
diff --git a/timelinejs.module b/timelinejs.module
index 1bf5644..9fd4791 100644
--- a/timelinejs.module
+++ b/timelinejs.module
@@ -104,9 +104,7 @@ function timelinejs_fetch_items($nid, $format = 'json') {
$nodes = timelinejs_load_events($nid);
foreach ($nodes as $node) {
- $content = node_load($node->entity_id);
- $content->tag = taxonomy_term_load($content->field_categoria['und'][0]['tid']);
- $items[] = $content;
+ $items[] = node_load($node->entity_id);
}
if (empty($items)) {
diff --git a/timelinejs_json_event.tpl.php b/timelinejs_json_event.tpl.php
index 60b88c2..75ab055 100644
--- a/timelinejs_json_event.tpl.php
+++ b/timelinejs_json_event.tpl.php
@@ -2,8 +2,8 @@
"startDate":"<?php print strftime('%Y,%m,%d', strtotime($event->field_date['und'][0]['value'])); ?>",
"headline":"<?php print $event->title; ?>",
"text":"<?php print timelinejs_strip($event->body['und'][0]['value']); ?>",
-<?php if (isset($event->tag) && $event->tag != FALSE) { ?>
- "tag":"<?php print $event->tag->name; ?>",
+<?php if (isset($event->field_tag) && isset($event->field_tag['und'][0]['value'])) { ?>
+ "tag":"<?php print $event->field_tag['und'][0]['value']; ?>",
<?php } ?>
"asset":
{