From d3bd496999530e89df86bc674a7f9803b87cf20e Mon Sep 17 00:00:00 2001 From: Fabian Vogler Date: Fri, 15 Mar 2024 10:35:52 +0100 Subject: [PATCH] Add support for SVG in navbar logo --- blocks/image/templates/worldskills_navbar_brand.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/blocks/image/templates/worldskills_navbar_brand.php b/blocks/image/templates/worldskills_navbar_brand.php index e2dbe59..adbe4d5 100644 --- a/blocks/image/templates/worldskills_navbar_brand.php +++ b/blocks/image/templates/worldskills_navbar_brand.php @@ -8,7 +8,17 @@ 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,