• Resolved cazuma

    (@cazuma)


    Hi,

    The plugin works great, except that in the admin side, in wordpress block editor, the images are not replaced for inline SVGs. The default style-svg class is applied automatically but the images remains there as img tags.

    Is there a way to fix this? As in the new gutenberg block editor the visual experience is important, it would be nice to be able to apply fill and stroke css colors in the backend too, for example.

    Thanks,
    Cazuma.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Hi there,

    Thanks for your support and using my plugin!

    I’ll be working on better Gutenberg integration very soon. But I use plain text blocks and put the IMG code there for swapping out to inline SVG usually.

    However, I absolutely want to make a nice visual experience using SVG in Gutenberg, it’s coming ??

    Thread Starter cazuma

    (@cazuma)

    Hi Benbodhi,

    Good to know you have plans for Gutenberg blocks!

    Actually, my issue at the moment is that I am developing some blocks myself and would like to apply your plugin’s svg substitution in my custom blocks’ previews in the editor. Is there some jsx function I can put the image markup through that would trigger the conversion in this context?

    Thank you for your time.

    Plugin Author Benbodhi

    (@benbodhi)

    Hey,
    Oh interesting! I’d love to see what you’re doing.

    I’m actually developing a block specifically for SVG, or I may extend the image block. Playing with options to find the most intuitive, and also trying to plan ahead for more features with SVG.

    You may be able to enqueue my plugin’s JS file into admin, that renders them inline on the frontend usually, to do some handling on the admin side. But hard to say if that’s going to work and do what you want. You can use it to scour the DOM (or apply it to specific areas only since it doesn’t need to scan the whole page) and find IMG tags that have the class. It may work in admin. I’ve not tried.

    I’ll actually be looking at some server side processing for inline rendering, which should allow us to view the inline SVG in admin and no need for front end DOM scouring.

    I hope this helps. Very interested in what you’re working on that needs inline SVG in the admin ??

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SVG in WP block editor’ is closed to new replies.