summaryrefslogtreecommitdiff
path: root/timelinejs.module
diff options
context:
space:
mode:
Diffstat (limited to 'timelinejs.module')
-rw-r--r--timelinejs.module7
1 files changed, 7 insertions, 0 deletions
diff --git a/timelinejs.module b/timelinejs.module
index 5d3ce9f..9c61b88 100644
--- a/timelinejs.module
+++ b/timelinejs.module
@@ -92,6 +92,13 @@ function timelinejs_json($nid) {
$items[] = node_load($node->entity_id);
}
+ if (empty($items)) {
+ $items[0] = new stdClass();
+ $items[0]->field_date['und'][0]['value'] = NULL;
+ $items[0]->title = t('No items');
+ $items[0]->body['und'][0]['value'] = t('Currently there are new items in this timeline');
+ }
+
foreach ($items as $event) {
$output[] = theme('timelinejs_json_event', array('event' => $event));
$events = implode(',', $output);