|
@@ -77,7 +77,7 @@ discard block |
|
|
block discarded – undo |
|
77
|
77
|
} |
|
78
|
78
|
|
|
79
|
79
|
$hero_callout_width = $entity->get('field_callout_width')->getString(); |
|
80
|
|
- switch($hero_callout_width) { |
|
|
80
|
+ switch ($hero_callout_width) { |
|
81
|
81
|
case '03': |
|
82
|
82
|
$hero_callout_width = 'col col-md-5 col-lg-3'; |
|
83
|
83
|
break; |
|
@@ -111,12 +111,12 @@ discard block |
|
|
block discarded – undo |
|
111
|
111
|
} |
|
112
|
112
|
|
|
113
|
113
|
$wrapper = [ |
|
114
|
|
- '#prefix' => '<div class="container"><div class="col-12"><div class="row ' . $hero_alignment . '">', |
|
|
114
|
+ '#prefix' => '<div class="container"><div class="col-12"><div class="row '.$hero_alignment.'">', |
|
115
|
115
|
'#suffix' => '</div></div></div>', |
|
116
|
116
|
'#type' => 'container', |
|
117
|
117
|
'#weight' => -1, |
|
118
|
118
|
'#attributes' => [ |
|
119
|
|
- 'class' => ['hero-block-fields', $hero_callout_width ], |
|
|
119
|
+ 'class' => ['hero-block-fields', $hero_callout_width], |
|
120
|
120
|
], |
|
121
|
121
|
'#children' => [], |
|
122
|
122
|
]; |
|
@@ -125,7 +125,7 @@ discard block |
|
|
block discarded – undo |
|
125
|
125
|
$icon = $build[$field_name]['#object']->field_icon->getString(); |
|
126
|
126
|
if (!empty($icon)) { |
|
127
|
127
|
$wrapper['#children'][$field_name] = [ |
|
128
|
|
- '#markup' => '<i class="fa ' . $icon . ' hero-icon"></i>', |
|
|
128
|
+ '#markup' => '<i class="fa '.$icon.' hero-icon"></i>', |
|
129
|
129
|
'#allowed_tags' => ['i'], |
|
130
|
130
|
]; |
|
131
|
131
|
} |
|
@@ -138,15 +138,15 @@ discard block |
|
|
block discarded – undo |
|
138
|
138
|
} |
|
139
|
139
|
|
|
140
|
140
|
$hero_first_line_size = $entity->get('field_first_line_size')->getString(); |
|
141
|
|
- $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-' . $hero_first_line_size; |
|
|
141
|
+ $wrapper['#children']['field_first_line']['#attributes']['class'][] = 'size-'.$hero_first_line_size; |
|
142
|
142
|
|
|
143
|
143
|
$hero_second_line_size = $entity->get('field_second_line_size')->getString(); |
|
144
|
|
- $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-' . $hero_second_line_size; |
|
|
144
|
+ $wrapper['#children']['field_second_line']['#attributes']['class'][] = 'size-'.$hero_second_line_size; |
|
145
|
145
|
|
|
146
|
146
|
// Attach styles. |
|
147
|
147
|
$alignment = $entity->get('field_hero_alignment')->getString(); |
|
148
|
148
|
if (preg_match('/^[a-z_]+$/i', $alignment)) { |
|
149
|
|
- $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('text-align-' . $text_alignment); |
|
|
149
|
+ $wrapper['#attributes']['class'][] = Html::cleanCssIdentifier('text-align-'.$text_alignment); |
|
150
|
150
|
} |
|
151
|
151
|
$color_regex = '/^#[0-9a-f]{6}$/i'; |
|
152
|
152
|
$callout_background_color = $entity->get('field_callout_background_color')->getString(); |
|
@@ -159,8 +159,8 @@ discard block |
|
|
block discarded – undo |
|
159
|
159
|
$wrapper['#attributes']['style'] = $callout_background_color; |
|
160
|
160
|
$text_color = $entity->get('field_text_color')->getString(); |
|
161
|
161
|
if (preg_match($color_regex, $text_color)) { |
|
162
|
|
- $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
163
|
|
- $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: ' . $text_color; |
|
|
162
|
+ $wrapper['#children']['field_first_line']['#attributes']['style'] = 'color: '.$text_color; |
|
|
163
|
+ $wrapper['#children']['field_second_line']['#attributes']['style'] = 'color: '.$text_color; |
|
164
|
164
|
} |
|
165
|
165
|
if ($entity->get('field_gradient')->getString()) { |
|
166
|
166
|
$gradient_color = $entity->get('field_gradient_color')->getString(); |
|
@@ -183,7 +183,7 @@ discard block |
|
|
block discarded – undo |
|
183
|
183
|
} |
|
184
|
184
|
$callout_color = $entity->get('field_callout_color')->getString(); |
|
185
|
185
|
if (preg_match($color_regex, $callout_color)) { |
|
186
|
|
- $style = 'background-color: ' . $callout_color . ';'; |
|
|
186
|
+ $style = 'background-color: '.$callout_color.';'; |
|
187
|
187
|
$hex = trim($callout_color, '#'); |
|
188
|
188
|
$r = hexdec(substr($hex, 0, 2)); |
|
189
|
189
|
$g = hexdec(substr($hex, 2, 2)); |
|
@@ -236,7 +236,7 @@ discard block |
|
|
block discarded – undo |
|
236
|
236
|
if (isset($variables['elements']['content']) && isset($variables['elements']['content']['#block_content'])) { |
|
237
|
237
|
/** @var \Drupal\block_content\Entity\BlockContent $entity */ |
|
238
|
238
|
$entity = $variables['elements']['content']['#block_content']; |
|
239
|
|
- $suggestions[] = 'block__block_content__' . $entity->bundle(); |
|
|
239
|
+ $suggestions[] = 'block__block_content__'.$entity->bundle(); |
|
240
|
240
|
} |
|
241
|
241
|
} |
|
242
|
242
|
|
|
@@ -533,7 +533,7 @@ discard block |
|
|
block discarded – undo |
|
533
|
533
|
// 'Current @Entity_Type' category. If the block is not a field on the |
|
534
|
534
|
// current entity, allow its category to be remapped. |
|
535
|
535
|
if ($category === '@entity') { |
|
536
|
|
- $block_info[$key]['category'] = $info['category']->render() . ' Fields'; |
|
|
536
|
+ $block_info[$key]['category'] = $info['category']->render().' Fields'; |
|
537
|
537
|
} |
|
538
|
538
|
// Place Block Content entities into categories based on their type. |
|
539
|
539
|
elseif ($category === 'Custom') { |