1.0.2 • Published 2 years ago

directus-custom-hook-svg-to-code v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

directus-svg-to-code

Directus extension hook to get svg code from svg files

npm.io

Steps:

  1. First install the package "npm install directus-custom-hook-svg-to-code"
  2. create a file "extensions/hooks/svg-to-code/index.js"
  3. put var e = require('directus-custom-hook-svg-to-code'); module.exports = e; in that index.js file
  4. Start directus.
  5. Go to Settings>Data Model>System Collections(drop down)>Directus Files
  6. Create a new field with key "svg_code" and type "text". Also, make this field read only.
  7. Now when you upload an svg file, this field will immediately be filled with the svg code for that file.