B
B
be_a_man2017-09-17 20:43:01
MODX
be_a_man, 2017-09-17 20:43:01

TinyMCE remove widht and height substitution for images?

4c9915eee9f44d8d9e4aa708840094a3.png
TinyMCE automatically resizes the image when added to an article. The site is responsive and no dimensions are needed.
1. How to overcome it?
2. Is there a solution for resizing images that are inserted into an article in the editor? You need to cut to 1600px maximum in width.
3. Inconvenient to embed video. Perhaps there is a solution to embed a YouTube video by simply specifying the ID?
4. Maybe there is another editor with all these features?
PS: We are talking about a text editor in MODX
UPD: I found a solution for the first point. We go along the path yourSite / assets / components / tinymcerte / js / mgr / tinymcerte.js
Looking for: Ext.extend
Adding: valid_elements: "img[src|class|id]"
ad5caab168894b9b97324575d5294389.png
The rest are open.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
uhogorlonos, 2020-03-09
@be_a_man

The method is good, but if you look at the official documentation https://www.tiny.cloud/docs-3x/reference/configura... in this way we cut off all other tags except img. For example, I <p>can’t insert now - the whole text goes in one paragraph.
It is correct to do this (by the way, they forgot to add alt to the allowed attributes, which is not superfluous at all, fixed it):

Ext.extend(TinyMCERTE.Tiny,Ext.Component,{
    cfg: {
        selector: '#ta'
        ,document_base_url: MODx.config.base_url
        ,file_browser_callback_types: 'file image media'   
        ,extended_valid_elements: "img[src|class|id|alt]"
    }

L
Localhost, 2017-09-17
@selo

in this editor there is an html view, there find a piece with a video and remove the widht and height parameters, then save the page

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question