Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Plugin support
  3. » ebl_quill

#1 2025-01-12 09:19:52

TheEric
Plugin Author
From: Colorado & Montana.
Registered: 2004-09-17
Posts: 597
Website

ebl_quill

ebl_quill_editor: Quill Integration for Textpattern

I’ve developed a plugin that replaces the standard Body and Excerpt textareas in Textpattern’s Write panel with the Quill rich text editor. Quill provides a modern editing experience with features like headings, formatting tools, media embedding, and more.

If you’re looking for a clean, flexible WYSIWYG editor for Textpattern, you can download it here.

This does away with the need for TinyMCE and its 1000 limited uses.

Let me know if you have any feedback.

Offline

#2 2025-01-12 17:00:43

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,851
Website GitHub

Re: ebl_quill

Cool! Always nice to have a new option.

One of the aspects that has hampered the adoption of other editors up to now – at least for me – has been the inability to use txp::shortcodes in the body and excerpt fields. I’m guessing that’s not possible here as the content is probably not parsed?


TXP Builders – finely-crafted code, design and txp

Offline

#3 2025-01-12 19:07:10

TheEric
Plugin Author
From: Colorado & Montana.
Registered: 2004-09-17
Posts: 597
Website

Re: ebl_quill

It supports shortcodes now as of 5 minutes ago.

    // Sync Quill content back to the hidden textarea, preserving shortcodes
    quillBody.on('text-change', function() {
      var htmlContent = quillBody.root.innerHTML;

      // Convert encoded <txp::...> back to raw shortcodes
      htmlContent = htmlContent.replace(/&lt;(txp::[a-zA-Z0-9_:]+)([^>]*)&gt;/g, '<$1$2>');

      // Update the textarea
      $body.val(htmlContent);
    });

    // Load initial content from the textarea, then encode shortcodes for Quill rendering
    var initialContent = $body.val();
    initialContent = initialContent.replace(/<(txp::[a-zA-Z0-9_:]+)([^>]*)>/g, '&lt;$1$2&gt;');
    quillBody.root.innerHTML = initialContent;
  }

Offline

#4 2025-01-14 18:33:02

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 116
Website

Re: ebl_quill

I’ve tried this on 4.8.8, 4.9.0.dev-1, and 4.9.0.dev-2 and I got nothing.

Am I missing a setting? Or a install?

Offline

#5 2025-01-15 05:55:28

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 116
Website

Re: ebl_quill

It turns out I was missing a setting. When you click on a plugin, there is a new panel that allows one to edit the loading order, etc.

This plugin defaulted to ‘public’. I changed it to ‘back end’ and it works great.

Thank you for the work, The Eric.

Offline

#6 2025-03-08 10:08:20

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,851
Website GitHub

Re: ebl_quill

I’ve been playing around a bit with your various plugins, Eric, and have made a few minor fixes for my own purposes, such as using the core nonce-aware functions for embedding css and js, removing some trailing UI elements, standard help text formatting, and some dumbing down of the available editing options. I can send you those should you be interested.

Aside from that, it seems Quill has a few quirks in that it has no support for br line-breaks, and apparently that it replaces spaces with &nbsp;. For the first there’s a PR awaiting approval, for the second there’s another PR (or simpler this one). There seems to have been quite some pushback on the space->non-breaking-space issue, which apparently was in response to the problem of multiple spaces being lost in cut-and-paste operations. In txp, I don’t see it having any effect. Spaces are stored as 20 in the database, so I presume ebl_quill is not using that Quill function. It seems that multiple spaces are preserved in the editor, e.g. at the beginning of a line, but they don’t show in the rendered HTML, of course, so there’s a mismatch there. From reading the comments, it seems the Quill maintainers are in no hurry to adopt PRs, so I was debating whether to perhaps include an own build of quill in the plugin, especially regarding the shift+return br aspect.

Some other general things I noted:

  • The function for embedding an image in the text edit editor is nice, but its inclusion as a data:img string is entirely independent of Textpattern’s own image storage system, thus making srcset options or figure/figcaption impossible.
  • I’d definitely offer my users fewer options. For example: until browsers support nested heading hierarchies (which looks ever less likely to happen), including h1 could result in SEO conflicts with the main heading on the page. I discovered one can add individual h2, h3, h4 buttons.
  • It would probably be prudent to set the textile_body and textile_excerpt fields to 0 for articles saved using the quill editor.
  • One thing that would be really helpful would be for the toolbar to be sticky on scroll, as otherwise it’s only of use for the upper part of longer article. CSS’s position: sticky doesn’t help here, as it’s relative to the body textarea container and that auto-expands, so my guess is it needs some js to stick beneath the menu bar when the textareas are longer than the display height.

TXP Builders – finely-crafted code, design and txp

Offline

#7 2025-03-23 06:23:50

TheEric
Plugin Author
From: Colorado & Montana.
Registered: 2004-09-17
Posts: 597
Website

Re: ebl_quill

ok? These are quill improvements. Not textpattern implementation improvements. When textpattern supports Nonce natively, I’ll implement it. Until then I’ll stick with CSP/htaccess.

Offline

  1. Index
  2. » Plugin support
  3. » ebl_quill

Board footer

Powered by FluxBB