You are here

cheeseburger_menu.module in Cheeseburger Menu 8.4

Cheeseburger Menu module file.

File

cheeseburger_menu.module
View source
<?php

/**
 * @file
 * Cheeseburger Menu module file.
 */
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_theme().
 */
function cheeseburger_menu_theme($existing, $type, $theme, $path) {
  return [
    'cheeseburger_menu' => [
      'variables' => [
        'tree' => [],
        'show_navigation' => TRUE,
        'parent_menu_as_link' => FALSE,
      ],
    ],
  ];
}

/**
 * Implements hook_page_attachments().
 */
function cheeseburger_menu_page_attachments(array &$page) {
  $page['#attached']['library'][] = 'cheeseburger_menu/cheeseburger_menu.js';
}

/**
 * Implements hook_help().
 */
function cheeseburger_menu_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.cheeseburger_menu':
      $output = '';
      $output .= '<h2>INTRODUCTION</h2>';
      $output .= '<p>The Cheeseburger Menu module can display system menu and Taxonomy terms. You can choose what you want to display and on which devices. If you are the using Commerce module you can also choose to show cart and phone buttons. </p>';
      $output .= '<h2>REQUIREMENTS</h2>';
      $output .= '<p>This module requires only the core modules. If you want to use Commerce features you should install Commerce Store.</p>';
      $output .= '<h2>INSTALLATION</h2>';
      $output .= '<p>Install as you would normally install a contributed Drupal module. Visit:' . 'https://drupal.org/documentation/install/modules-themes/modules-8' . 'for further information.</p>';
      $output .= '<h2>CONFIGURATION</h2>';
      $output .= '<p>This module requires only the core modules. If you want to use Commerce features you should install Commerce Store.</p>';
      $output .= '<p>In block configuration:</p>';
      $output .= '<ul><li>First check menus and taxonomies you want to display</li>';
      $output .= '<li>Choose their weight to order them as you want</li>';
      $output .= '<li>Also choose the site header height and menu title padding</li>';
      $output .= '<li>Enable breakpoints. Choose on which devices you want to display the menu.' . 'This is based on breakpoints from your default theme. So if you want to change it,' . 'make your changes in default_theme_name.breakpoints.yml</li></ul>';
      return $output;
  }
}