Skip to content

Commit

Permalink
Add verticle align middle to Grid Widget
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Jul 22, 2024
1 parent b862971 commit d4135bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/elements/grid/grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
$min_height = $params->get('min_height', 0);
$overlay_type = $params->get('overlay_type', '');
$enable_grid_match = $params->get('enable_grid_match', 0);
$vertical_middle = $params->get('vertical_middle', 0);

$box_shadow = $params->get('card_box_shadow', '');
$box_shadow = $box_shadow ? ' ' . $box_shadow : '';
Expand Down Expand Up @@ -180,7 +181,7 @@

echo '<div id="grid-'. $grid -> id .'" class="as-grid"><div class="card' . $card_style . $box_shadow . $box_shadow_hover .$bd_radius . $card_hover_transition . ($enable_grid_match ? ' h-100' : '') . '">';
if ($media_position == 'left' || $media_position == 'right') {
echo '<div class="row g-0">';
echo '<div class="row g-0'.($vertical_middle ? ' align-items-center' : '').'">';
echo '<div class="'.$media_width_cls.'">';
}
if ($media_position != 'inside') {
Expand Down
1 change: 1 addition & 0 deletions framework/elements/grid/grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@
<option value="5">5/12</option>
<option value="7">7/12</option>
</field>
<field astroidgroup="card_options" ngShow="[media_position]=='left' OR [media_position]=='right'" name="vertical_middle" type="astroidradio" astroid-switch="true" default="0" label="ASTROID_WIDGET_VERTICAL_MIDDLE"/>
<field astroidgroup="card_options" name="enable_grid_match" type="astroidradio" astroid-switch="true" default="0" label="ASTROID_WIDGET_ENABLE_GRID_MATCH"/>
<field astroidgroup="card_options" name="card_hover_transition" type="astroidlist" label="ASTROID_WIDGET_HOVER_TRANSITION_LABEL" default="">
<option value="">TPL_ASTROID_DEFAULT</option>
Expand Down
1 change: 1 addition & 0 deletions language/en-GB/en-GB.astroid.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,7 @@ ASTROID_WIDGET_META_POSITION_LABEL="Meta Position"
ASTROID_BEFORE_TITLE="Before Title"
ASTROID_AFTER_TITLE="After Title"
ASTROID_WIDGET_ENABLE_GRID_MATCH="Enable Grid Match"
ASTROID_WIDGET_VERTICAL_MIDDLE="Vertical Align Middle"

; Video Button
ASTROID_WIDGET_VIDEO_BUTTON_LABEL="Video Button"
Expand Down

0 comments on commit d4135bc

Please sign in to comment.