Craft CMS Asked by user11054 on January 2, 2021
I want to have an asset field which only allows .svg
s.
To be more specific, I want to upload icons I can later import in my templates via the svg()
command. Is this possible without any plugins or a custom field?
You can achieve this using the extraFileKinds
config setting like this:
'extraFileKinds' => [
'svg' => [
'label' => 'SVG',
'extensions' => ['svg'],
],
],
On your Asset field, check the "Restrict allowed file types?" checkbox, and select "SVG" from the list.
Correct answer by André Elvan on January 2, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP