Resize by default TinyMCE - tinymce

I'm using TinyMCE for the first time, and I love it, but is a bit closed.
I'd like to get images resized by default, this is, when adding an image, put it by default on 300px width, for example (then the user can make it bigger or smaller dragging).
I don't know where to touch! Is there a command within the lists of images (the js you can attach to make TinyMCE show a list of images)? Or I have to hack css? Or I have to dive into TinyMCE code?
Thank you in advance
Marc

If you are OK with changing code files then proceed as follows
Open tiny_mce/plugins/advimage/js/image.js
Locate insertAndClose : function()
Insert after
var ed = tinyMCEPopup.editor, ......;
if(f.width.value == ""){
f.width.value = 300;
}
Hope it helps!

There are several options. I would go the css way. Check out the tinycme init configuration setting content_css. Using an additioanl own css file enables you to setthe width of images to 300px easily.

Related

How to resize an image with clickable link in README.md file?

I have been trying to add a link to one of the YouTube videos in the README.md file. So, first I took a screenshot of the video at a specific timestamp, put it in the local directory, and then used the following syntax:
[![ALT TEXT] (image/screenshot path)] (https://youtu.be/video_id "video text")
But as the size of the screenshot is a little big (as big as my laptop screen), using the above syntax takes a lot of space in the output! I don't want that. I want to control the size of the screenshot/image. How can I do that?
I found different answers on adding an image with a clickable link; resize an image in readme; but I couldn't find any answer addressesing both the issues. (Sorry if such answer already exists)
Thanks a lot in advance :)
You can include raw HTML in your Markdown document, so just use standard HTML <a> and <img> tag with width and height atttributes:
<img src="path/to/img.png" width="xxx" height="yyy">
This will render correctly on github and elsewhere.

typo3 flexslider should user original image and not cropped one

In my typo3 7.6.19 Website I want to user the flexslider plugin.
That works fine, my problem is that the image is a cropped one and not the original file I uploaded.
How can I change it to use the original picture?
Thanks in advance
The plugin sets up a TypoScript constant
plugin.tx_wsflexslider.maxwidth=800px
You can modify this value in your TypoScript template (Module Template > Constant Editor > select "PLUGIN.TX_WSFLEXSLIDER"
About your other problem that is artifacts in the reduced image, I think that when resizing an image from 2550px to 800px, it is probable that the quality will be reduced :) You could check those settings in Install Tool >All Configuration > Image Processing [GFX] and see if you can improve them.
A last word: I would not use images of 2550px, it seems that they will be very heavy! I would try to set a compromise (e.g. plugin.tx_wsflexslider.maxwidth=1200px).
You could also evalutate the extension EXT:image_autoresize https://extensions.typo3.org/extension/image_autoresize/
to automatically resize the images when uploading them and limit the weight or dimensions of the images that your editor will upload.
From this answer typo3 uses crop images how can I avoid this I see that (of course) you can also modify the partial that renders the image and avoid using the TypoScript constants at all, but for the reasons I mentioned above, I would not recommend it.
In TYPO3 10.4.x and ws_slider 0.9.8, it was not a constant but:
<f:image image="{item.foregroundMedia.0}" maxWidth="600" />
in
Resources/Private/Partials/Item/Flexslider.html

Why are animated gif in typo3 not shown

I have in my Typo3 Content text and image. And i would like to insert a animated gif. I first made it normal, than i recognized that the gif changed to .png files.
After a few test I found the parameter (FE png_to_gif), in the Install Tool.
But when I choose this. The gif files has the path fileadmin/processed but there are no gif files in this directory.
Can anybody help me that i can display my animated gifs ?
Thank you.
If the image you are processing is resized or modified by ImageMagick/GraphicsMagick, all frames of an animation will be lost. Use the orginal size in the frontend to avoid this.
Hi try select "None (ignores all other options)" under Apperance->Quality and Type
gl
Like Merec answered: the animation will be lost trough processing ...
an option is to intervene on the rendering of the fluid-template: in your own extension you overwrite the original fluid-template and find the image-viewhelper the ouputs the image:
This processes the image also when no width or height are given
<f:image image="{imageObject}" />
This without size will not (or use the variable directly)
<f:image src="{imageObject.0.originalResource.publicUrl}" />
(note that an imageobject is often an array, to find that out <f:debug>{_imageObject}</f:debug> or <f:debug>{_all}</f:debug>)

Inserting and Displaying images within the TinyMCE content editor in PHP site

I am currently using tinyMCE to edit content within my site and I am looking for a way display an image within the tinyMCE once it has been uploaded to the site.
Note: I am not looking for a means to upload an image directly into tinyMCE. I am looking for the tinyMCE command which would allow me to display an image within the content in the editor after I have uploaded it.
Thanks
You could insert a regular img-tag inside tinymce using a custom plugin or using the setup parameter in your tinymce init. The src should refer to the html location of the image to be uploaded. As soon as the image is available the image will become visible on next reload of the editors content. If you need further assistance feel free to ask.
After successfull uploaded you have the source of the image (img_src). Now you need to add it to the editor like this
tinymce.activeEditor.insertContent('<img alt="photo" src="' + img_src + '"/>');

iphone detect new style sheet

I am trying to trouble shoot a css issue that is appearing only in iphone browsers. I simply need to detect if the user is using an iphone, and if so, render a modified version of the div that is being affected.
I am happy to just call this modified version of the css div in the header as it will save having a second style sheet.
You used to be able to do it between browsers. It was especially good when rendering a IE6 fix.
Thanks for your help in advanced.
James
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
// do something
}