Skip to content

[6.0] Add custom classes to the class dropdown in the image dialog in TinyMCE#45676

Merged
softforge merged 5 commits intojoomla:6.0-devfrom
RickR2H:image-classes
Jul 23, 2025
Merged

[6.0] Add custom classes to the class dropdown in the image dialog in TinyMCE#45676
softforge merged 5 commits intojoomla:6.0-devfrom
RickR2H:image-classes

Conversation

@RickR2H
Copy link
Member

@RickR2H RickR2H commented Jul 2, 2025

Pull Request for Issue # .

Summary of Changes

  • Added the option to define custom classes for the image class dropdown in the TinyMCE plugin configuration, while keeping the default classes.
  • When selecting "No Class Selected" in the image class dropdown, the class property is completely removed from the image.

image-class

Testing Instructions

  1. Build the CSS.
  2. Go to the TinyMCE plugin configuration.
  3. Scroll to the bottom of the page to the Image Classes List parameter.
  4. Click the green + symbol to add a custom class.
  5. Add a custom class with name: myclass and value: myclass.
  6. Go to an article and add an image.
  7. Select the image and click the image icon in the editor icon bar.
  8. Open the class dropdown and select the created class: myclass and click Save.
  9. Open the Source Code Editor in TinyMCE and check if the class is in the image tag.

    img-class-dropdown2
  10. Open the image dialog again and remove the class by clicking: No Class Selected.
  11. Check if the class property is removed from the image tag.

Actual result BEFORE applying this Pull Request

No classes can be added

Expected result AFTER applying this Pull Request

Classes can be added in the configuration and selected in the image class dropdown in TinyMCE

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-6.0-dev labels Jul 2, 2025
@RickR2H RickR2H changed the title Added option to define image classes Add custom classes to the class dropdown in the image dialog in TinyMCE Jul 2, 2025
@tecpromotion tecpromotion changed the title Add custom classes to the class dropdown in the image dialog in TinyMCE [6.0] Add custom classes to the class dropdown in the image dialog in TinyMCE Jul 11, 2025
@hans2103
Copy link
Contributor

I have tested this item ✅ successfully on b244ebc

followed test instructions and was able to see myClass in the classList. Nice feature


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45676.

@exlemor
Copy link

exlemor commented Jul 11, 2025

I have tested this item ✅ successfully on b244ebc

I have tested this successfully - cool add-on!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45676.

@RickR2H
Copy link
Member Author

RickR2H commented Jul 14, 2025

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45676.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jul 14, 2025
@softforge softforge added this to the Joomla! 6.0.0 milestone Jul 23, 2025
@softforge softforge merged commit f385871 into joomla:6.0-dev Jul 23, 2025
33 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jul 23, 2025
@softforge
Copy link
Contributor

Thank you to the author for this feature and the testers who did their bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators PR-6.0-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments