Skip to content
Snippets Groups Projects
Verified Commit 97ca0616 authored by Dave Long's avatar Dave Long
Browse files

Issue #2942016 by Rassoni, markconroy, David_Rothstein, kaythay, smustgrave,...

Issue #2942016 by Rassoni, markconroy, David_Rothstein, kaythay, smustgrave, John Cook, catch: Add a hook_help() to the Umami profile, and link to it from the toolbar when the Help module is enabled
parent 8b6814e4
Branches
Tags
31 merge requests!8528Issue #3456871 by Tim Bozeman: Support NULL services,!8323Fix source code editing and in place front page site studio editing.,!6278Issue #3187770 by godotislate, smustgrave, catch, quietone: Views Rendered...,!3878Removed unused condition head title for views,!38582585169-10.1.x,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3668Resolve #3347842 "Deprecate the trusted",!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3147Issue #3328457: Replace most substr($a, $i) where $i is negative with str_ends_with(),!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2614Issue #2981326: Replace non-test usages of \Drupal::logger() with IoC injection,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2334Issue #3228209: Add hasRole() method to AccountInterface,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!844Resolve #3036010 "Updaters",!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #72451 canceled
......@@ -7,6 +7,28 @@
use Drupal\contact\Entity\ContactForm;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
/**
* Implements hook_help().
*/
function demo_umami_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.demo_umami':
$output = '';
$output .= '<h2>' . t('About') . '</h2>';
$output .= '<p>' . t('Umami is an example food magazine website that demonstrates some of the features of Drupal core. It is intended to be used as an example site, rather than as a foundation for building your own site. For more information, see the <a href=":demo_umami">online documentation for the Umami installation profile</a>.', [':demo_umami' => 'https://www.drupal.org/node/2941833']) . '</p>';
$output .= '<h2>' . t('Uses') . '</h2>';
$output .= '<h3>' . t('Demonstrating Drupal core functionality') . '</h3>';
$output .= '<p>' . t('You can look around the site to get ideas for what kinds of features Drupal is capable of, and to see how an actual site can be built using Drupal core.') . '</p>';
$output .= '<h3>' . t('Sample content') . '</h3>';
$output .= '<p>' . t('The Umami profile is very handy if you are developing a feature and need some sample content.') . '</p>';
$output .= '<h2>' . t('What to do when you are ready to build your Drupal website') . '</h2>';
$output .= '<p>' . t("Once you've tried Drupal using Umami and want to build your own site, simply reinstall Drupal and select a different installation profile (such as Standard) from the install screen.") . '</p>';
return $output;
}
}
/**
* Implements hook_form_FORM_ID_alter() for install_configure_form().
......@@ -64,12 +86,16 @@ function demo_umami_toolbar() {
// Show warning only on administration pages.
$admin_context = \Drupal::service('router.admin_context');
if ($admin_context->isAdminRoute()) {
$link_to_help_page = \Drupal::moduleHandler()->moduleExists('help') && \Drupal::currentUser()->hasPermission('access administration pages');
$items['experimental-profile-warning']['#type'] = 'toolbar_item';
$items['experimental-profile-warning']['tab'] = [
'#type' => 'inline_template',
'#template' => '<a class="toolbar-warning" href="{{ more_info_link }}">This site is intended for demonstration purposes.</a>',
'#context' => [
'more_info_link' => 'https://www.drupal.org/node/2941833',
// Link directly to the drupal.org documentation if the help pages
// aren't available.
'more_info_link' => $link_to_help_page ? Url::fromRoute('help.page', ['name' => 'demo_umami'])
: 'https://www.drupal.org/node/2941833',
],
'#attached' => [
'library' => ['demo_umami/toolbar-warning'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment