diff --git a/config/settings.py b/config/settings.py index b1e758ce..9f1588d4 100644 --- a/config/settings.py +++ b/config/settings.py @@ -315,6 +315,7 @@ def show_toolbar(request): ) WAGTAILIMAGES_EXTENSIONS = ["gif", "jpg", "jpeg", "png", "webp", "svg"] +SF_SCHEME_DEPENDENT_SVGS = True if os.getenv("SF_SCHEME_DEPENDENT_SVGS", False) == "True" else False # Allows for complex Streamfields without completely removing checks DATA_UPLOAD_MAX_NUMBER_FIELDS = 10000 diff --git a/content_manager/templates/content_manager/blocks/image_svg_or_raster.html b/content_manager/templates/content_manager/blocks/image_svg_or_raster.html index 3ba3c1d6..e5aef75f 100644 --- a/content_manager/templates/content_manager/blocks/image_svg_or_raster.html +++ b/content_manager/templates/content_manager/blocks/image_svg_or_raster.html @@ -1,8 +1,9 @@ -{% load wagtailimages_tags %} +{% load wagtailimages_tags wagtail_dsfr_tags %} {% image value.image original as artwork %} +{% settings_value "SF_SCHEME_DEPENDENT_SVGS" as scheme_dependent_svgs %} -{% if artwork.file.name|slice:"-4:" == ".svg" %} +{% if scheme_dependent_svgs and artwork.file.name|slice:"-4:" == ".svg" %}