Questions tagged [svg]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
14 views

Change the fill or stroke colour of an SVG using a field value?

Is it possible to change the fill or stroke colour of an SVG using a value pulled from a custom field? For example: {{ svg('@webroot/_dist/stat/link-arrow.svg')|attr({ stroke: '{{ entry....
2
votes
1answer
22 views

Only allow SVG as file type

I want to have an asset field which only allows .svgs. 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 ...
1
vote
1answer
18 views

Outputting SVG from an asset field inside a matrix field with svg()

I've set up an asset field inside a matrix field where a user can upload SVG icons, but I'm having trouble outputting them using the svg() function. {# Correctly shows the path #} {{ callout.icon[0]....
1
vote
1answer
181 views

Craft 3 icons not found in craftcms/cms/src/icons

Craft 3 version 3.0.4 When logging into the admin panel on Craft3 for some reason I'm getting a Yii2 PHP Warning for missing icons. Error message: PHP Warning – yii\base\ErrorException ...
2
votes
1answer
134 views

Smart Map with linked SVG icons for markers

I have a smart map where I'm trying to use linked SVG files for the marker icons. In Safari, the files load at actual size, which in this case is fine, but in Chrome and Edge, they are scaled up, and ...
1
vote
1answer
37 views

Requesting SVGs from a plugins resources directory doesn't work

I have an SVG file in my plugins resources, I'd like to use the asset in the front end. {{ resourceUrl('cocktailrecipes/images/gin.svg') } It seems using the resourceURL() only allows a select few ...
3
votes
1answer
548 views

Odd behaviour when uploading .svg Assets

Running 2.6.2983 on OS Sierra. I'm noticing that some of my SVG files when uploading are going from 50kb to 1kb and then appear completely blank when trying to view them. Does anyone have a clue why ...
0
votes
1answer
199 views

svgicons fieldtype - how to output in template?

I've added a field called icons of type svg-icons and am able to select icons I've added without an issue. I am having trouble outputting them on the front end however. I get twig errors no matter ...
1
vote
0answers
111 views

Disable SVG previews for asset field?

A client of mine uploads multiple, complex SVGs (2MB and larger) to an asset field. Unfortunately, Craft CMS isn't able to automatically generate thumbnail images (with a reduced filesize, not just ...