Skip to content

Commit

Permalink
Add support for SVG in navbar logo
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian committed Mar 15, 2024
1 parent 8b53268 commit d3bd496
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion blocks/image/templates/worldskills_navbar_brand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@
<?php if (is_object($f)): ?>

<?php
if ($maxWidth > 0 || $maxHeight > 0) {
if ($f->getTypeObject()->isSVG()) {
$tag = new \HtmlObject\Image();
$tag->src($f->getRelativePath());
if ($maxWidth > 0) {
$tag->width($maxWidth);
}
if ($maxHeight > 0) {
$tag->height($maxHeight);
}
$tag->addClass('ccm-svg');
} elseif ($maxWidth > 0 || $maxHeight > 0) {
$im = Core::make('helper/image');
$thumb = $im->getThumbnail(
$f,
Expand Down

0 comments on commit d3bd496

Please sign in to comment.