diff --git a/theme/wetkit_breadcrumbs.theme.inc b/theme/wetkit_breadcrumbs.theme.inc index e636ade..210d952 100644 --- a/theme/wetkit_breadcrumbs.theme.inc +++ b/theme/wetkit_breadcrumbs.theme.inc @@ -28,6 +28,13 @@ function wetkit_breadcrumbs_breadcrumb($variables) { array_pop($breadcrumbs); } + $path_breadcrumbs_data = path_breadcrumbs_load_variant(current_path()); + // Append page title when un-managed by path_breadcrumbs + $show_unlinked_page_title = variable_get('path_breadcrumbs_show_page_title', 0); + if ($show_unlinked_page_title && !isset($path_breadcrumbs_data->variant)) { + $breadcrumbs[] = drupal_get_title(); + } + // Add options for rich snippets. $elem_tag = 'li'; $elem_property = ''; @@ -149,7 +156,6 @@ function wetkit_breadcrumbs_breadcrumb($variables) { // Show contextual link if it is Path Breadcrumbs variant. $prefix = ''; - $path_breadcrumbs_data = path_breadcrumbs_load_variant(current_path()); if (user_access('administer path breadcrumbs') && $path_breadcrumbs_data && isset($path_breadcrumbs_data->variant)) { $contextual_links = array( '#type' => 'contextual_links', diff --git a/wetkit_breadcrumbs.module b/wetkit_breadcrumbs.module index 9a577f1..7e1113e 100644 --- a/wetkit_breadcrumbs.module +++ b/wetkit_breadcrumbs.module @@ -85,6 +85,12 @@ function wetkit_breadcrumbs_configure_form($form, &$form_state) { '#description' => t('Title of the link that points to the front page.'), '#size' => 30, ); + $form['wetkit_breadcrumbs']['path_breadcrumbs_show_page_title'] = array( + '#type' => 'checkbox', + '#title' => t('Append the current page title for un-managed breadcrumbs'), + '#default_value' => variable_get('path_breadcrumbs_show_page_title', 0), + '#description' => t('When a page is not managed by Path Breadcrumbs (no variants activated), append the current page title (unlinked) to the list of breadcrumbs.'), + ); $form['#submit'][] = 'wetkit_breadcrumbs_configure_form_submit'; return system_settings_form($form);