modxcms / fred

The friendly front-end editor for visual, drag-and-drop content building in MODX CMS
https://fred.modx.com
MIT License
59 stars 25 forks source link

[Feature Request] - Editor selection option #429

Closed robcarey closed 4 months ago

robcarey commented 2 years ago

Fred is amazing. We're building some spectacular functionality with this tool.

One pain point we frequently run into is we have an element that is sort of the meat and potatoes - basically a rich text editor area. Quite often we need to include snippet calls or chunk calls in this area and while it "works", it really falls apart quickly as a manageable experience. TinyMCE in source mode is really poor.

  1. It reformats code - this makes finding nested things difficult.
  2. No syntax/color highlighting. We don't need Visual Studio level - ACE editor does this just fine for these scenarios
  3. Probably the most frustrating is the changing of snippet and chunk parameter calls - replacing ampersands with the html entity equivalent of & This is very messy working with complex calls at a minimum and occasionally destructive.

I know a workaround here is "Put your code in a chunk", and it's currently how we do handle this. This is not however ideal - we're running into chunk creep to some degree and all agree having the ability to just put the call in context on the resource is preferable.

Any chance of allowing for ACE as the code view option?

matdave commented 2 years ago

That is more of a plugin request. I'm sure someone could make it happen. You could create a very open config in the MCE options that allows for basically just TinyMCE with the HTML editor option, and all elements valid. Like e.g.

{
  "theme": "inlite",
  "inline": true,
  "plugins": "code",
  "selection_toolbar": "code",
  "valid_elements": "*[*]"
}
robcarey commented 2 years ago

A plugin makes sense. I suppose the existing RTE editor is enabled as a plugin. The ACE editor has color highlighting and line numbers and does not ever mess with the content. That would be ideal in my books.

Also - the above example for valid elements is what I currently have. It does not respect those options at all.