Blog Sections Open

Adding Lazy-Loading Image Classes to TinyMCE in Evolution CMS

A small TinyMCE customization that adds a lazy-loading class option directly to the image dialog in Evolution CMS.

If editors insert many content images through TinyMCE, it is useful to make lazy-loading available directly in the editor UI instead of expecting every author to write classes by hand.

The idea

Extend the image class list in the TinyMCE integration so editors can choose a class such as lazyload from the dialog.

Example customization

Edit the TinyMCE integration file and extend the image class list:

$this->set('image_class_list', '[
    {title: "None", value: ""},
    {title: "LazyLoad", value: "lazyload"},
    {title: "Float left", value: "justifyleft lazyload"},
    {title: "Float right", value: "justifyright lazyload"}
]');

What this gives editors

  • a visible and repeatable choice in the image dialog
  • consistent class names across articles
  • less manual HTML cleanup later

What to verify after the change

  • your front-end lazy-loading script actually targets the chosen class
  • existing content still renders correctly
  • the modified TinyMCE integration is documented for future upgrades

This is a small customization, but it is exactly the kind of editor-quality improvement that makes day-to-day content work smoother.

Newer post

AJAX Forms in Evolution CMS 3 with Routing, Validation, Request, and Response

A guide to AJAX form handling in Evolution CMS 3 using Laravel-style routing, validation, request handling, and structured responses.

Older post

A Practical Cheat Sheet for Teams Moving from Other CMSs to Evolution CMS

A short orientation guide for teams coming from WordPress, MODX Revolution, or other CMS platforms and trying to understand which Evolution CMS tools map to familiar tasks.