Module Description
SVG Formatter module provides support for using SVG images on your website.
The standard image field in Drupal 8/9/10 doesn't support SVG images. This module adds a new formatter for the file field, which allows files with any extension to be uploaded. In the formatter settings, you can set the default image size and enable alt and title attributes. If you want to add some CSS and Javascript magic to your SVG images, then use the inline SVG option.
You can also use this module in combination with SVG Image module. If that module is installed, you can use the SVG Formatter formatter for the image field.
Installation
Composer
composer require drupal/svg_formatter
Drush
drush en svg_formatter -y
How to use it?
Drupal 8 and SVG images - Blog post describing how to use the module
Screencast: https://youtu.be/ctussLn-2Ck
1. Add a file field to your content type, taxonomy, or any other entity type, and add svg to the allowed file extensions. 2. Go to the 'Manage display' and change the field format to 'SVG Formatter'. 3. Set image dimensions if you want and enable or disable attributes.
The standard image field in Drupal 8/9/10 doesn't support SVG images. This module adds a new formatter for the file field, which allows files with any extension to be uploaded. In the formatter settings, you can set the default image size and enable alt and title attributes. If you want to add some CSS and Javascript magic to your SVG images, then use the inline SVG option.
You can also use this module in combination with SVG Image module. If that module is installed, you can use the SVG Formatter formatter for the image field.
Installation
Composer
composer require drupal/svg_formatter
Drush
drush en svg_formatter -y
How to use it?
Drupal 8 and SVG images - Blog post describing how to use the module
Screencast: https://youtu.be/ctussLn-2Ck
1. Add a file field to your content type, taxonomy, or any other entity type, and add svg to the allowed file extensions. 2. Go to the 'Manage display' and change the field format to 'SVG Formatter'. 3. Set image dimensions if you want and enable or disable attributes.
Module Link
Project Usage
4166
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
SVG Formatter module solves the issue of using SVG images on a website by adding support for SVG images in Drupal 8/9/10 through a new formatter for the file field.
Data Name
svg_formatter