Display svg in editor's view, eg: record list page when using Everything SVG plugin [Modified title]

Hi there,

Thank you very much for the raw SVG feature! That’s a great help for us to manage the Icons.
I’m already using it in our product!

But it’s not that straightforward for the editor to manage the SVGs in the portal, it displays the svg field as a string now in the item record list (screenshot attached).

image

Could it be possible to display it properly in the list?

Thank you very much! :smiling_face_with_three_hearts:

Hi Zoe,

Welcome to the Dato forums!

Normally we do show SVGs in the preview column:

But I think in your specific case, that SVG code is being pasted as text inside a textfield, as opposed to being uploaded as an actual image in the media area. Our UI doesn’t “know” that the icon field holds an image; it just looks like any other text.

In your case, it looks like that field is using the “Everything SVG” community plugin? That is a third-party plugin that we do not directly maintain. I think @devoorhoede (who wrote the plugin) might have to add a buildItemPresentationInfo() hook to that plugin to render a preview for it in the collections screens. Let’s see if they notice this post, but if not, could you please raise an issue with them at their Github? https://github.com/voorhoede/datocms-plugin-everything-svg/issues/new

Thank you I got it!

1 Like

@zoe,

I wanted to make sure that hook works the way I thought it would (it does), and ended up making a PR for that plugin: https://github.com/voorhoede/datocms-plugin-everything-svg/pull/4

Once the maintainer looks it over, hopefully they can accept the patch and add the feature for you :slight_smile:

OMG, you are so nice!!! And FAST :zap::zap:
I submitted an issue yesterday to ask if the author has interests on the preview things, and thinking about to take a pr my self. I’m too slow hhahhaa.

Thank you!!