Skip to content

Commit

Permalink
fix: do not display placeholder in full variant. Do not show error wh…
Browse files Browse the repository at this point in the history
…en image is missng, show placeholder.
  • Loading branch information
Sebastian Thulin committed Oct 11, 2024
1 parent c0d37db commit 5b5a0ab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions acf-fields/json/card.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "image",
"type": "focuspoint",
"instructions": "",
"required": 1,
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
Expand Down Expand Up @@ -272,4 +272,4 @@
"acfe_meta": "",
"acfe_note": ""
}]


13 changes: 8 additions & 5 deletions acf-fields/php/card.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

if (function_exists('acf_add_local_field_group')) {
acf_add_local_field_group(array(


if (function_exists('acf_add_local_field_group')) {

acf_add_local_field_group(array(
'key' => 'group_63ff1e1238bd3',
'title' => __('Card Section Settings', 'modularity-sections'),
'fields' => array(
Expand All @@ -11,7 +13,7 @@
'name' => 'image',
'type' => 'focuspoint',
'instructions' => '',
'required' => 1,
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
Expand Down Expand Up @@ -275,4 +277,5 @@
'acfe_meta' => '',
'acfe_note' => '',
));
}

}
3 changes: 2 additions & 1 deletion source/php/Module/Card/views/card.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
'paddingBottom' => $spacing_bottom,
'stretch' => !is_admin() && isset($blockData) ? (bool) $blockData['align'] == 'full' : $stretch,
'context' => ['sectionsCard', 'sections', 'sections.card', 'module.sections.card'],
'buttons' => !empty($buttons) ? $buttons : []
'buttons' => !empty($buttons) ? $buttons : [],
'hasPlaceholder' => true,
])
@if (!empty($submodules) && is_array($submodules))
{!! $submoduleRendered !!}
Expand Down
1 change: 1 addition & 0 deletions source/php/Module/Full/views/full.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'paddingTop' => $spacing_top,
'paddingBottom' => $spacing_bottom,
'stretch' => !is_admin() && isset($blockData) ? (bool) $blockData['align'] == 'full' : $stretch,
'hasPlaceholder' => false,
'context' => ['sectionsFull', 'sections', 'sections.full', 'module.sections.full']
])
@if (!empty($submodules) && is_array($submodules))
Expand Down

0 comments on commit 5b5a0ab

Please sign in to comment.