📜 ⬆️ ⬇️

Aloha Editor for MODX Revolution



I want to talk about the new plugin for MODX Revolution for editing text (including the values ​​of additional TV fields) in the outer part of the site.
Used by Aloha Editor ( aloha-editor.org ).

This visual editor has drawbacks, for example, the size of JS scripts (stuck in everything that is possible), but it is quite convenient. I know that there is a Frontpage add-on for MODX Revolution and there is even an Aloha Editor (already an outdated version), but I really didn’t like the integration implementation.
')
Installation and Setup

  1. Install the plugin via System -> Package Management.
  2. Go to “Elements” -> “Plugins” -> “aloha_editor” -> “Parameters”.
  3. Set parameters:

    content_fields - JSON array of fields for editing and element selectors in the HTML layout.
    Example:
    {"pagetitle":".title", "content":"#page-content"}
    In this case, you can edit the contents of the HTML element with the CSS class “title” (title) and the element with the ID “page-content” (content of the resource).

    tv_fields - JSON array of additional fields (TV) for editing and element selectors in HTML layout.
    {"tv3":"#param1", "tv4":"#param2"}
    tv3 is a TV with ID = 3.

    usergroups is a user group for which an editor is available in the outer part of the site (several can be separated by commas). If not specified, access is granted to all authorized in the context of “mgr” and having rights to save_document.


If the plugin does not work, check that the system event is “OnWebPagePrerender”.
The user must be authorized in the context of “mgr” (admin) and have rights to the action “save_document” (Security -> Access Control -> Access Policies -> Group).

Conflicts with JS-libraries should not be, it is taken into account in the Aloha Editor.

Be careful if you have a habit of inserting calls to snippets into content, because This plugin (for the time being) saves the HTML code as it is at the output (the snippets are already calculated). (already decided)

Download

You can download only here , because the file size turned out to be large, and there are limitations in the MODX repository (maybe we will solve this problem).

The integration is done by studio "Simple Dream" .

Updated June 23, 2012
Version 1.0pl1 released. The loading of the original (unreadable) field and TV contents was made when clicking the “Enable” button in order to save the calls of snippets and modifiers when saving. Plus other fixes.


Updated 11.07.2012
The restriction on the size of the file in the MODX repository has been reduced, and now it can be installed in the admin panel via “Package Management”. modx.com/extras/package/aloha

Source: https://habr.com/ru/post/144517/


All Articles