verbb / icon-picker

A Craft CMS field to select SVG or font icons from a folder for use in your content.
Other
17 stars 8 forks source link

SVG Sprite doesn't display icons #10

Closed knynkwl closed 4 years ago

knynkwl commented 5 years ago

Description

When adding a sprite icon, it doesn't display in the field selector.

This is the svg markup:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <defs>
        <symbol id="icon-home" viewBox="0 0 32 32">
            <title>home</title>
            <path d="M32 18.451l-16-12.42-16 12.42v-5.064l16-12.42 16 12.42zM28 18v12h-8v-8h-8v8h-8v-12l12-9z"></path>
        </symbol>
        <symbol id="icon-home2" viewBox="0 0 32 32">
            <title>home2</title>
            <path d="M16 1l-16 16 3 3 3-3v13h8v-6h4v6h8v-13l3 3 3-3-16-16zM16 14c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"></path>
        </symbol>
    </defs>
</svg>

The icons that are display correctly are single svg images in the folder.

This is how it displays: Screen Shot 2019-04-16 at 12 35 58 PM

Additional info

engram-design commented 5 years ago

Should be fixed in 1.0.6

knynkwl commented 5 years ago

This doesn't seem to be fixed, we are using icomoon symbol-defs.svg

engram-design commented 5 years ago

Just following up on this, and its producing expected results as per the attached (using your initial example).

Is it still showing blank for the icon? Is the file called *-sprites.svg? Are there any console errors, or 404's?

Screen Shot 2019-05-23 at 6 22 29 pm

knynkwl commented 4 years ago

Ah yeah it's working, thanks