CptPillow

HI everyone. How can I add templates to the TinyMCE in ss4? in SS3 I would do something like the answer in this thread: https://www.silverstripe.org/community/forums/customising-the-cms/show/23046

CptPillow

@Joe Hi Jo sorry for only messaging back now. How would I go about doing that?

CptPillow

Dont think that shortcode will work for them

CptPillow

The client wants to use the svg in the TinyMCE so I need to get it to work

wmk

well, if tiny removes all javascript in svg it might be secure. Did you look at stackoverflow? https://stackoverflow.com/questions/37862695/tinymce-and-svg seems to be quite helpful

Show 1 attachment(s)
Stack Overflow  
TinyMCE and SVG

I'm using the latest/current TinyMCE editor (<script type="text/javascript" src='https://cdn.tinymce.com/4/tinymce.min.js'></script>) and it doesn't seem capable of displaying <svg&g...

Hide attachment content
dorsetdigital

If you haven't already, you'll probably need to enable SVG for the whole site as well: https://forum.silverstripe.org/t/adding-svg-to-the-allowed-files-in-ss4/883

Show 1 attachment(s)
Silverstripe Forum  
Adding SVG to the allowed files in SS4

This one comes up quite a lot on the Slack channel, so I thought it was worth a post here as well. The below is specific to SVG files, but the same techniques apply to other extensions. The first thing to note is that, contrary to what your instinct might think, an SVG isn’t an image file. In SilverStripe, images are bitmap-style files such as jpg, gif, png, etc. and when you use them, you get all kinds of extra manipulation classes. Because of this, SVG files needs to be stored in File ...

Hide attachment content
CptPillow

@wmk did not see that post. busy looking through it now

CptPillow

I can add SVG as a link but not as image so far.

dorsetdigital

But that's the point. I don't know, because I've never tried it, but you may need to do some extra work if you want MCE to actually treat it like an image. It may not be possible with 'normal' configuration options

wmk

ouch... the "add an image" button in Silverstripe CMS is for pixel images, yes.

wmk

well, tiny should have another button for it and it should be possible to extend the silverstripe button somehow.

CptPillow

well looks like I caught a break. They happy with the solution I found where you link it as a file then go into the code editor to change it to a image

🎉 (1)

Show less replies
CptPillow

Hi everyone. Has anyone worked with SVG files in the TinyMCE? I want to add SVG files but not sure what would be the best way to allow it