Skip to content

Commit

Permalink
Merge pull request #3627 from CityOfBoston/DIG-5063
Browse files Browse the repository at this point in the history
DIG-5063 Replace SVG embed with svg image
  • Loading branch information
subaha-cob authored Oct 2, 2024
2 parents 656f9cb + 6c68424 commit 5e88743
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions docroot/themes/custom/bos_theme/bos_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,16 @@ function bos_theme_preprocess_image(&$variables) {
$path = \Drupal::request()->getSchemeAndHttpHost();
$variables['uri'] = str_replace("https://assets.boston.gov/icons", $path . "/themes/custom/patterns/assets/icons", $variables['uri']);
}

/*
* TODO: Review if the rest of the code in that hook is still actually required.
*/
// Load the icon.
$icon = file_get_contents($variables['uri']);
//$icon = file_get_contents($variables['uri']);
// If the icon is in the format //domain/file then add scheme.
$icon = preg_replace(['/<\?xml.*\?>/i', '/<!DOCTYPE((.|\n|\r)*?)">/i'], '', $icon);
$variables['icon'] = Xss::filter($icon, explode(' ', BOS_CORE_SVG_ELEMENTS));
$variables['attributes']->removeAttribute("src");
/*$icon = preg_replace(['/<\?xml.*\?>/i', '/<!DOCTYPE((.|\n|\r)*?)">/i'], '', $icon);*/
//$variables['icon'] = Xss::filter($icon, explode(' ', BOS_CORE_SVG_ELEMENTS));
//$variables['attributes']->removeAttribute("src");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ What: Fixes the department icon to be 100px square. (Iterators issue #39)
*/
@media screen and (min-width: 980px) {
.node-type-department-profile .department-icon {
padding: 13px 0 0 15px;
padding: 0 0 0 4px;
}
}
.node-department-profile .department-icon svg {
Expand Down

0 comments on commit 5e88743

Please sign in to comment.