Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/8.x-2.x' into 8.x-2.x-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
szatom committed Oct 5, 2017
2 parents b5ea8b5 + 055ae98 commit 60f9870
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions parade.module
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,13 @@ function parade_preprocess_paragraph__text_boxes(&$variables) {
*/
function parade_theme($existing, $type, $theme, $path) {
return [
'paragraph' => [],
'paragraph__header' => [
'paragraph__parade' => [
'base hook' => 'paragraph',
],
'paragraph__parallax' => [
'paragraph__header' => [
'base hook' => 'paragraph',
],
'paragraph__simple' => [
'template' => 'paragraph',
'paragraph__parallax' => [
'base hook' => 'paragraph',
],
'paragraph__text_box' => [
Expand All @@ -154,22 +152,6 @@ function parade_theme($existing, $type, $theme, $path) {
'paragraph__text_boxes' => [
'base hook' => 'paragraph',
],
'paragraph__images' => [
'template' => 'paragraph',
'base hook' => 'paragraph',
],
'paragraph__image_text' => [
'template' => 'paragraph',
'base hook' => 'paragraph',
],
'paragraph__locations' => [
'template' => 'paragraph',
'base hook' => 'paragraph',
],
'paragraph__social_links' => [
'template' => 'paragraph',
'base hook' => 'paragraph',
],
'parade_preview' => [
'variables' => ['paragraph' => NULL],
],
Expand Down Expand Up @@ -215,15 +197,15 @@ function parade_theme_suggestions_paragraph_alter(array &$suggestions, array $va
$attributes->get('_entity_form') !== "node.edit" &&
$attributes->has('node') &&
method_exists($node, 'hasField') &&
$node->hasField('parade_machine_name')
$node->hasField('parade_onepage_id')
) {
if (is_object($node) && ($machine_name = $node->get('parade_machine_name')->value)) {
if (is_object($node) && ($machine_name = $node->get('parade_onepage_id')->value)) {
/** @var string[] $suggestions */
$parade_suggestions = [];
foreach ($suggestions as $suggestion) {
$parade_suggestions[] = preg_replace("/^paragraph__/", 'paragraph__' . $machine_name . "__", $suggestion);
}
$suggestions = array_merge($suggestions, $parade_suggestions);
$suggestions = array_merge(['paragraph__parade'], $suggestions, $parade_suggestions);
}
}
}
Expand Down
File renamed without changes.

0 comments on commit 60f9870

Please sign in to comment.