![Status](https://img.shields.io/static/v1?message=active&label=Status&style=for-the-badge&labelColor=666666&color=2FAC66 "The status badge describes if the project is maintained. Possible values are active and inactive. If a project is inactive it means that the development has been discontinued and won't support future CoreMedia versions." )
This extension adds SVG support to the CoreMedia Blueprint.
The extension can be installed in your Blueprint workspace in two ways. Either by adding this repository as a Git submodule or by copying the code directly. The recommended approach is to add the extension as a Git submodule.
Add this repository or your fork as a Git submodule to your existing CoreMedia Blueprint workspace in the modules/extensions
folder.
This way, you will be able to merge new commits made in this repo back to your fork.
From the project's root folder, clone this repository as submodule into the modules/extensions
folder. Make sure to use the branch name that matches your workspace version.
git submodule add https://github.com/coremedia-contributions/blueprint-svg-support.git modules/extensions/svg
Use the extension tool in the root folder of the project to link the modules into your workspace.
mvn -f workspace-configuration/extensions extensions:sync -Denable=svg
Download a copy of this repository and extract the files into your Blueprint workspace to modules/extensions/svg
.
This repository also contains a custom brick that needs to be added to your frontend.
Add a reference to the svg-support
brick to the frontend/workspace.yaml
.
packages:
...
- '../modules/extensions/svg/frontend/bricks/svg-support'
Afterwards you can include the brick in your theme by adding the following dependency in the theme package.json
.
"@coremedia/brick-svg-support": "^1.0.0",
If an CMSVG
content should be created, when business users upload SVG files in Studio, you need to adapt the UploadSettings
(/Settings/Options/Settings/UploadSettings
) by adding/adjusting the following mapping:
<StructProperty Name="mimeTypeMappings">
<Struct>
...
<StringProperty Name="image/svg+xml">CMSVG</StringProperty>
</Struct>
</StructProperty>
For more details, please consult the section 6.1.14 Upload Files in the Blueprint Developer Manual.