Problems with TinyMCE alignment of images

General questions relating to Joomla! 5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
theartistep
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat May 18, 2024 1:44 pm

Problems with TinyMCE alignment of images

Post by theartistep » Mon May 27, 2024 2:39 pm

On Joomla 5, the editor in TinyMCE is adding a bit of code (class=”float-none” ) to allow images to float right or left .

It can be corrected by going into the source code and removing the "-none".

Appearance in J5 TinyMCE editor after inserting image and aligning to the left.
Float Image in Editor J5.png
Actual result on front end when saved
Float image result J5.png
The editor is adding a snip of code for the image class (float-none). If you view source code and remove the "-none" it will correct it when save.
Float Image source code J5.png
Either I'm missing something or it should be fixed.
You do not have the required permissions to view the files attached to this post.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2794
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Problems with TinyMCE alignment of images

Post by ceford » Mon May 27, 2024 9:32 pm

Your code has style statements. I don't think that comes from TinyMCE, so neither does float-none. Do you have other media plugins enabled?

theartistep
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat May 18, 2024 1:44 pm

Re: Problems with TinyMCE alignment of images

Post by theartistep » Tue May 28, 2024 8:26 pm

These weren't issues on these sites with Joomla 4.*. These just happened with the upgrade from 4.4 to 5.

The solution does solve the problem

Go to:
/public_html/plugins/editors/tinymce/src/PluginTraits/PluginTrait.php

On the PluginTrait.php, locate
449 ['title' => 'None', 'value' => 'float-none'],

And, Replace with:
449 ['title' => 'None', 'value' => 'float'],

Hopefully it will be fixed.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2794
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Problems with TinyMCE alignment of images

Post by ceford » Tue May 28, 2024 9:17 pm

Trying to understand the problem! The actual file is DisplayTrait.php. I am not sure changing float-none to float will do anything.

Those options turn up in the article edit form when you select an image and then the insert/edit image icon. At the bottom of the form you get a choice of None, Left, Right, Centre. They work as expected for me.

How are you inserting images? Is it in the body of the text or with the Images and Links tab?

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12809
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Problems with TinyMCE alignment of images

Post by brian » Wed May 29, 2024 3:00 pm

There is absolutely nothing in any version of joomla that will change the content you have created on update. That is a fundamental principal behind the updates. Do not touch the user created content - ever!!
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/


Post Reply

Return to “General Questions/New to Joomla! 5.x”