SVG Formatter

Categories

Component ID

2844350

Component name

SVG Formatter

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

4038

Component created

Component changed

Component body

Standard image field in Drupal 8 doesn't support SVG images. If you really want to display SVG images on your website then you need another solution. This module adds a new formatter for the file field, which allows any file extension to be uploaded. In the formatter settings you can set 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 inline SVG option.

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

1. Add a file field to your content type or taxonomy vocabulary 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.

Do you want to request a feature or to report a bug? Please create an issue I will respond to you as fast as I can. This module is still in development phase, so your ideas are always welcomed.

Studio Present