diff --git a/ds.ds_fields_info.inc b/ds.ds_fields_info.inc index ad73753..f50aa50 100644 --- a/ds.ds_fields_info.inc +++ b/ds.ds_fields_info.inc @@ -170,8 +170,9 @@ function ds_ds_fields_info($entity_type) { if (!empty($ui_limit)) { $fields['node']['book_navigation'] = array( 'title' => t('Book navigation'), - 'field_type' => DS_FIELD_TYPE_IGNORE, + 'field_type' => DS_FIELD_TYPE_FUNCTION, 'ui_limit' => $ui_limit, + 'function' => 'ds_render_book_navigation', ); } } diff --git a/ds.module b/ds.module index c9a6e08..3d18e60 100644 --- a/ds.module +++ b/ds.module @@ -1187,6 +1187,16 @@ function ds_render_user_picture($field) { } /** + * Render book navigation, complete with table of contents and book pager. + */ +function ds_render_book_navigation($field) { + $node = $field['entity']; + if (!empty($node->book['bid']) && empty($node->in_preview)) { + return theme('book_navigation', array('book_link' => $node->book)); + } +} + +/** * Render a date field. */ function ds_render_date_field($field) {