-
Notifications
You must be signed in to change notification settings - Fork 3
/
bootstrap_paragraphs.module
79 lines (75 loc) · 2.04 KB
/
bootstrap_paragraphs.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* @file
* Bootstrap Paragraphs module file.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_theme().
*/
function bootstrap_paragraphs_theme($existing, $type, $theme, $path) {
return [
'paragraph__default' => [
'base hook' => 'paragraph',
],
'paragraph__bp_accordion' => [
'base hook' => 'paragraph',
],
'paragraph__bp_carousel' => [
'base hook' => 'paragraph',
],
'paragraph__bp_tabs' => [
'base hook' => 'paragraph',
],
'paragraph__bp_columns_three_uneven' => [
'base hook' => 'paragraph',
],
'paragraph__bp_columns_two_uneven' => [
'base hook' => 'paragraph',
],
'paragraph__bp_image' => [
'base hook' => 'paragraph',
],
'paragraph__bp_modal' => [
'base hook' => 'paragraph',
],
'field__entity_reference_revisions' => [
'base hook' => 'paragraph',
],
'field__paragraph__bp_column_content' => [
'base hook' => 'paragraph',
],
'field__paragraph__bp_column_content_2' => [
'base hook' => 'paragraph',
],
'field__paragraph__bp_column_content_3' => [
'base hook' => 'paragraph',
],
'field__paragraph__bp_image__image' => [
'base hook' => 'paragraph',
],
];
}
/**
* Implements hook_help().
*
* @inheritdoc
*/
function bootstrap_paragraphs_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.bootstrap_paragraphs':
$text = file_get_contents(dirname(__FILE__) . "/README.md");
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}