a11y_paragraphs_tabs.module in A11Y Paragraphs Tabs 8
Module for creating the A11Y Paragraphs Tabs paragraph component.
File
a11y_paragraphs_tabs.moduleView source
<?php
/**
* @file
* Module for creating the A11Y Paragraphs Tabs paragraph component.
*/
/**
* Implements hook_theme().
*
* Call the base hook from Paragraphs to allow preprocess hooks to work.
*/
function a11y_paragraphs_tabs_theme() {
return [
'paragraph__a11y_paragraphs_tabs_wrapper' => [
'render element' => 'element',
'template' => 'paragraph--a11y-paragraphs-tabs-wrapper',
'base hook' => 'paragraph',
],
'field__field_a11y_para_tabs_tabs_panel' => [
'render element' => 'content',
'template' => 'field--field-a11y-para-tabs-tabs-panel',
'base hook' => 'field',
],
];
}
/**
* Implements hook_help().
*/
function a11y_paragraphs_tabs_help($route_name) {
switch ($route_name) {
case 'help.page.a11y_paragraphs_tabs':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('A11Y Paragraphs Tabs gives the user the ability to easily add tabs via paragraphs to their content that complies to Accessibility (A11Y) standards. On Desktop it shows Tabs and on mobile it displays as an accordion. For more information, see the <a href=":a11y_paragraphs_tabs">A11Y Paragraphs Tabs documentation on Drupal.org.</a>.', [
':a11y_paragraphs_tabs' => 'https://www.drupal.org/docs/8/modules/a11y-paragraphs-tabs',
]) . '</p>';
return $output;
case 'dblog.overview':
return '<p>' . t('A11Y Paragraphs Tabs gives the user the ability to easily add tabs via paragraphs to their content that complies to Accessibility (A11Y) standards.') . '</p>';
}
}
Functions
Name | Description |
---|---|
a11y_paragraphs_tabs_help | Implements hook_help(). |
a11y_paragraphs_tabs_theme | Implements hook_theme(). |