Proposal to Enhance the RichEditor in OctoberCMS: Support for FroalaEditor "InlineClasses"

Currently, OctoberCMS allows customization of certain aspects of the RichEditor configuration (based on FroalaEditor), such as “paragraphStyles”, which are useful for applying specific styles to entire paragraphs. However, this feature has a significant limitation when it comes to applying styles to individual words or a selection of text within a paragraph, without affecting the entire parent element.

To address this limitation, FroalaEditor natively provides a feature called “InlineClasses”, which enables applying CSS styles directly to specific text selections without impacting the overall paragraph style. This approach is ideal for scenarios where users want to highlight specific words or text fragments with a particular style while maintaining the overarching style of the paragraph.

Why Integrate “InlineClasses” into OctoberCMS’s RichEditor?

  1. Improved Style Granularity:
    Professional users, especially those managing rich content, often need to customize small portions of text. Adding “InlineClasses” would perfectly meet this need by enabling more precise style management.
  2. Leverage FroalaEditor’s Native Features:
    Since FroalaEditor already supports “InlineClasses,” this is more about exposing and integrating an existing feature into OctoberCMS rather than building a mechanism from scratch. This approach optimizes development effort while aligning with the capabilities of the underlying editor.
  3. Consistency and Compatibility with Modern Standards:
    “InlineClasses” use CSS classes, which offer greater compatibility and extensibility with modern front-end frameworks. This approach ensures standardization and makes maintaining styles easier for developers.
  4. Enhanced User Experience:
    Providing end-users the ability to apply styles at the inline text level would make OctoberCMS more competitive for projects requiring precise editorial control, such as blogs, publishing sites, or e-commerce platforms.

Concrete Implementation Proposal:

  • Add a dedicated “InlineClasses” section to the RichEditor configuration, similar to the existing “paragraphStyles.”
  • Add the ability to provides InlineClasses from Plugins like registerInlineClasses function or something similar.
  • Allow end-users to select a class from a contextual menu after highlighting a portion of text.

Conclusion:

By exposing FroalaEditor’s “InlineClasses” functionality in OctoberCMS’s RichEditor, it would be possible to address advanced styling needs while leveraging the editor’s native capabilities. This would offer an elegant and efficient solution for users who wish to style specific text fragments, thereby enhancing the power and flexibility of OctoberCMS for creating and managing rich content.

1 Like