Questions tagged [svg]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

How to access an SVG file via GraphQL

I would like to insert an SVG tag directly into my Markup in order to make changes after the file was uploaded
1 vote
3 answers
132 views

SVG with <a> tag does not work

I want to put some links on an image. To be exact, this "Click here" would be a link. I supposed it would be possible with SVG image. However, tag does not work in web page powered by ...
  • 401
1 vote
1 answer
76 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....
  • 1,173
4 votes
1 answer
290 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
1 answer
124 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]....
  • 149
1 vote
1 answer
223 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 ...
  • 293
2 votes
1 answer
195 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 ...
  • 960
1 vote
1 answer
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 ...
  • 2,275
3 votes
1 answer
598 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
1 answer
249 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,907
1 vote
0 answers
140 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 ...