diff --git a/core/modules/tour/tour.module b/core/modules/tour/tour.module index 7c1e1d6..304ecad 100644 --- a/core/modules/tour/tour.module +++ b/core/modules/tour/tour.module @@ -150,20 +150,27 @@ function tour_preprocess_page(&$variables) { $index = 1; $count = count($tour_items); foreach ($tour_items as $tour_item) { - $list_items[] = array( - 'output' => $tour_item->getOutput(), - 'counter' => array( - '#type' => 'container', - '#attributes' => array( - 'class' => array( - 'tour-progress', + if ($output = $tour_item->getOutput()) { + $list_items[] = array( + 'output' => $output, + 'counter' => array( + '#type' => 'container', + '#attributes' => array( + 'class' => array( + 'tour-progress', + ), ), + '#children' => t('!tour_item of !total', array('!tour_item' => $index, '!total' => $count)), ), - '#children' => t('!tour_item of !total', array('!tour_item' => $index, '!total' => $count)), - ), - '#wrapper_attributes' => $tour_item->getAttributes(), - ); - $index++; + '#wrapper_attributes' => $tour_item->getAttributes(), + ); + $index++; + } + } + + // Whilst we have tour items, none of them provided any output. + if (empty($list_items)) { + return; } // Give the last tip the "End tour" button. diff --git a/core/profiles/standard/config/tour.tour.standard-lote-en.yml b/core/profiles/standard/config/tour.tour.standard-lote-en.yml new file mode 100644 index 0000000..6094ec2 --- /dev/null +++ b/core/profiles/standard/config/tour.tour.standard-lote-en.yml @@ -0,0 +1,14 @@ +id: standard-lote-en +label: Standard LOTE +langcode: en +paths: + - +tips: + translate-content: + id: translate-content + plugin: lote + label: Translating content + body: To create content in languages other than English, you need to enable the "Content Translation" module. This can be done from the "Extend" option in the menu. + weight: "1" + attributes: + data-class: toolbar #toolbar-bar .icon-menu diff --git a/core/profiles/standard/lib/Drupal/standard/Plugin/tour/tip/TipPluginFirstInstall.php b/core/profiles/standard/lib/Drupal/standard/Plugin/tour/tip/TipPluginFirstInstall.php new file mode 100644 index 0000000..2cf0574 --- /dev/null +++ b/core/profiles/standard/lib/Drupal/standard/Plugin/tour/tip/TipPluginFirstInstall.php @@ -0,0 +1,35 @@ +fields('n')->countQuery()->execute()->fetchField(); + if (!$is_first_install) { + // Not first install so don't show anything. + return FALSE; + } + return parent::getOutput(); + } +} diff --git a/core/profiles/standard/lib/Drupal/standard/Plugin/tour/tip/TipPluginLOTE.php b/core/profiles/standard/lib/Drupal/standard/Plugin/tour/tip/TipPluginLOTE.php new file mode 100644 index 0000000..a63be2f --- /dev/null +++ b/core/profiles/standard/lib/Drupal/standard/Plugin/tour/tip/TipPluginLOTE.php @@ -0,0 +1,33 @@ +langcode == 'en') { + return FALSE; + } + return parent::getOutput(); + } +}