Questions tagged [svg]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

Erratic behavior with anchor tag surrounding svg image

I'm using an svg object for a logo on a site. It is wrapped in an anchor tag. In the browser, the cursor is sometimes a pointer and other times a hand (showing it is a link). It's very erratic and ...
cbad's user avatar
  • 125
1 vote
1 answer

I'm trying to remove transforms if my image is an svg? Any tips or advice would be great

{% for icon in icons %} {% set image = ?? null %} {% if image %} <div class="c c-md-6 c-lg-6"> ...
Han's user avatar
  • 13
1 vote
3 answers

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 ...
Kota.M's user avatar
  • 423
1 vote
1 answer

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....
Martin's user avatar
  • 1,203
5 votes
1 answer

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 ...
user11054's user avatar
1 vote
1 answer

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]....
Jake1293's user avatar
  • 159
1 vote
1 answer

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 ...
Exziled's user avatar
  • 293
2 votes
1 answer

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 ...
artmem's user avatar
  • 1,022
1 vote
1 answer

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 ...
Mark Notton's user avatar
  • 2,337
3 votes
1 answer

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 ...
zedjay72's user avatar
0 votes
1 answer

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 ...
CreateSean's user avatar
  • 1,963
1 vote
0 answers

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 ...
Avant la lettre's user avatar