Developer forum

Forum » Swift » Images in RTE
Tina Engelsen Pedersen
Reply

Hi Dynamicweb

When inserting an image in RTE in swift, how come it's not possible to pick an image from the files archive? 

Also, the two functions for inserting an image in the RTE doesn't behave the same. When using the image function when clicking the three dots, you have to insert the path to an image:

When using the function that appears in the RTE text area, you have to choose an image form your computer. Where does these images end up?


Replies

 
Nicolai Pedersen
Reply

Hej Tina

Generally you should never insert images directly in the rich text editor. When you insert images in the image fields of the different content item types, the swift implementation is able to handle how the image look like in large displays all the way down to mobile devices and at the same time ensure that the image is optimized for performance.
When you insert images in the editor, you will potentially run into issues in smaller devices etc.

Currently it is not possible to select an image from the filemanager using the RTE (for the above reasons).

When you select an image inline from your pc it is embedded as base64 inside the editor markup (you can see that if you view the source) - example below. It works, but the image is not optimized and resized correctly and can easily cause performance problems if the editor inserts i.e. a photo from their camera which can be 4mb+ in size.

I am pretty sure you can achieve what you want by using one of the content item types available - otherwise we might be able to add that as a request to Swift.

Can you show what you are trying to achieve visually - then we might be able to guide you.

How the image data is embeded in the rich text editor

 
Tina Engelsen Pedersen
Reply

Hi Nicolai

I completely agree that images in the RTE sholdn't be used for the same reasons as you list :)

I don't have a concrete example for the use, but we are going to have a workshop with a customer soon, who we are setting up a swift site for, and they will probably ask what the function is for.

Of course we'll tell them that they should never insert images in the RTE, and repeat it when they forget and do it anyways, and it doesn't look good :) 
Could it be a possibility to remove it completely from the RTE, or is there a reason/use case for still having it available?
 

 
Nicolai Pedersen
Reply

Yes, of course - we should get rid of those options...!

I have created a config file for the editor configurations you can upload and take into use on your solution.

Attached find a zip file with a 'simple.json' inside it. Upload it to /Files/System/Editor/tinymce/config/ and select that file under editor configurations - see below.

 

 
Tina Engelsen Pedersen
Reply

Hi Nicolai

That's great, thanks :) 

I have compared the default file with the one you sent, but even though everything regarding images has been removed ind the simple.json file, it is still possible to insert an image when you click enter and make a new line. Is it possible to remove this as well?

 
Suzi Louring
Reply

Hi Nicolai

Can you tell me how to remove the button?
I have tried but without success.

Thanks :)

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Suzi

Remove that addin from the config file:

 
Suzi Louring
Reply

Hi Nicolai

Sorry, it's not working :(

It seems to remove thos one instead

 

 
Soe Moe Tun
Reply
This post has been marked as an answer

remove quickbars from plugin

Votes for this answer: 1
 
Suzi Louring
Reply

Thank you, Soe Moe :)

 

You must be logged in to post in the forum