Skip to content

Commit

Permalink
feat: allow icon for more appearances manual input (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasNorin authored Jan 16, 2025
1 parent c8110e1 commit 7ef702b
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 4 deletions.
30 changes: 29 additions & 1 deletion source/php/AcfFields/json/mod-manual-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,34 @@
"operator": "==",
"value": "list"
}
],
[
{
"field": "field_6752f959acfda",
"operator": "==",
"value": "card"
}
],
[
{
"field": "field_6752f959acfda",
"operator": "==",
"value": "block"
}
],
[
{
"field": "field_6752f959acfda",
"operator": "==",
"value": "segment"
}
],
[
{
"field": "field_6752f959acfda",
"operator": "==",
"value": "collection"
}
]
],
"wrapper": {
Expand All @@ -743,7 +771,7 @@
"id": ""
},
"choices": [],
"default_value": "arrow_forward",
"default_value": false,
"return_format": "value",
"multiple": 0,
"allow_custom": 0,
Expand Down
30 changes: 29 additions & 1 deletion source/php/AcfFields/php/mod-manual-input.php
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,34 @@
'value' => 'list',
),
),
2 => array(
0 => array(
'field' => 'field_6752f959acfda',
'operator' => '==',
'value' => 'card',
),
),
3 => array(
0 => array(
'field' => 'field_6752f959acfda',
'operator' => '==',
'value' => 'block',
),
),
4 => array(
0 => array(
'field' => 'field_6752f959acfda',
'operator' => '==',
'value' => 'segment',
),
),
5 => array(
0 => array(
'field' => 'field_6752f959acfda',
'operator' => '==',
'value' => 'collection',
),
),
),
'wrapper' => array(
'width' => '',
Expand All @@ -747,7 +775,7 @@
),
'choices' => array(
),
'default_value' => 'arrow_forward',
'default_value' => false,
'return_format' => 'value',
'multiple' => 0,
'allow_custom' => 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
'classList' => array_merge($input['classList'] ?? [], [$input['columnSize'], 'u-height--100']),
'context' => $context,
'link' => $input['link'],
'attributeList' => $input['attributeList'] ?? []
'attributeList' => $input['attributeList'] ?? [],
'icon' => $input['icon'] ? [
'icon' => $input['icon'],
'size' => 'md',
'color' => 'white'
] : null
])
@endblock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
'containerAware' => true,
'classList' => array_merge($input['classList'] ?? [], ['u-height--100']),
'hasPlaceholder' => $anyItemHasImage,
'icon' => $input['icon'] ? [
'icon' => $input['icon'],
'size' => 'md',
'color' => 'black'
] : null
])
@endcard
@endelement
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
'reverseColumns' => $imagePosition,
'classList' => array_merge($input['classList'] ?? [], [$input['columnSize']]),
'hasPlaceholder' => $anyItemHasImage,
'attributeList' => $input['attributeList'] ?? []
'attributeList' => $input['attributeList'] ?? [],
'icon' => [
'icon' => $input['icon'],
'size' => 'md',
'color' => 'black'
]
])
@endsegment
15 changes: 15 additions & 0 deletions source/php/Module/ManualInput/views/collection.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@
])
{{ $input['title'] }}
@endtypography
@if (!empty($input['icon']))
@element([
'classList' => [
'u-display--flex',
'u-detail-shadow-3'
]
])
@icon([
'icon' => $input['icon'],
'size' => 'md',
'color' => 'black'
])
@endicon
@endelement
@endif
@endgroup
@if(!empty($input['content']))
@typography([])
Expand Down

0 comments on commit 7ef702b

Please sign in to comment.