Skip to content

Commit

Permalink
Improved Image Group Addon
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed May 8, 2024
1 parent 755944a commit 8f19143
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
17 changes: 12 additions & 5 deletions framework/elements/imagegroup/imagegroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,17 @@
}

$row_gutter = $params->get('row_gutter', 4);
$gutter_cls = ' gx-' . $row_gutter;
$gutter_cls = ' gy-' . $row_gutter;
$column_gutter = $params->get('column_gutter', 4);
$gutter_cls .= ' gy-' . $column_gutter;

$border_radius = $params->get('border_radius', '');
$border_radius = $border_radius !== '' ? ' ' . $border_radius : '';
$gutter_cls .= ' gx-' . $column_gutter;

$rounded_size = $params->get('rounded_size', '3');
$border_radius = $params->get('border_radius', '');
if ($border_radius == 'rounded') {
$border_radius = ' ' . $border_radius . '-' . $rounded_size;
} else {
$border_radius = $border_radius !== '' ? ' ' . $border_radius : '';
}
$box_shadow = $params->get('box_shadow', '');
$box_shadow = $box_shadow !== '' ? ' ' . $box_shadow : '';
$hover_effect = $params->get('hover_effect', '');
Expand All @@ -129,6 +134,7 @@
foreach ($images as $image) {
$image_params = Style::getSubFormParams($image->params);
if (!empty($image_params['image'])) {
echo '<div>';
if ($image_params['use_link']) {
echo '<a href="'.$image_params['link'].'" title="'.$image_params['title'].'">';
}
Expand All @@ -138,6 +144,7 @@
if ($image_params['use_link']) {
echo '</a>';
}
echo '</div>';
}
}
echo '</div>';
Expand Down
7 changes: 7 additions & 0 deletions framework/elements/imagegroup/imagegroup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
<option value="rounded-circle">TPL_ASTROID_ICON_STYLE_CIRCLE</option>
<option value="rounded-pill">TPL_ASTROID_ICON_STYLE_PILL</option>
</field>
<field astroidgroup="widget_styles" ngShow="[border_radius]=='rounded'" type="astroidlist" name="rounded_size" label="ASTROID_WIDGET_ROUNDED_SIZE_LABEL" default="3">
<option value="1">X-Small</option>
<option value="2">Small</option>
<option value="3">Medium</option>
<option value="4">Large</option>
<option value="5">X-Large</option>
</field>
<field astroidgroup="widget_styles" name="box_shadow" type="astroidlist" label="ASTROID_WIDGET_BOX_SHADOW_LABEL" default="">
<option value="">TPL_ASTROID_DEFAULT</option>
<option value="shadow-none">ASTROID_WIDGET_SHADOW_NONE</option>
Expand Down

0 comments on commit 8f19143

Please sign in to comment.