Giter VIP home page Giter VIP logo

redactor's Introduction

Redactor icon

Redactor

This plugin adds a “Redactor” field type to Craft CMS, which provides a rich text editor powered by Redactor by Imperavi.

Requirements

This plugin requires Craft CMS 3.5 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Redactor”. Then click on the “Install” button in its modal window.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require craftcms/redactor

# tell Craft to install the plugin
./craft install/plugin redactor

Configuration

Redactor Configs

You can create custom Redactor configs that will be available to your Redactor fields. They should be created as JSON files in your config/redactor/ folder.

For example, if you created a config/redactor/Standard.json file with the following content:

{
  "buttons": ["html", "format", "bold", "italic", "lists", "link", "file"],
  "plugins": ["fullscreen"]
}

…then a “Standard” option would become available within the “Redactor Config” setting on your Redactor field’s settings.

See the Redactor documentation for a list of available config options and buttons.

Craft Redactor config options

Craft addes the enforceButtonOrder config option that can be set to a list of button names in the expected order. This option should be used to address the uncontrollable button order set by Redactor when adding plugins to the configuration.

HTML Purifier Configs

Redactor fields use HTML Purifier to ensure that no malicious code makes it into its field values, to prevent XSS attacks and other vulnerabilities.

You can create custom HTML Purifier configs that will be available to your Redactor fields. They should be created as JSON files in your config/htmlpurifier/ folder.

Copy Default.json as a starting point, which is the default config that Redactor fields use if no custom HTML Purifier config is selected.

See the HTML Purifier documentation for a list of available config options.

Redactor JS Plugins

All first party Redactor JS plugins are bundled by default. To enable them, just add the plugin handle to the plugin array in your Redactor config.

{
  "plugins": ["alignment", "fullscreen"]
}

You can also supply your own Redactor plugins by saving them in your config/redactor/ folder. You can either place the plugin directly in that folder, or within a subfolder that is named after the plugin:

config/
└── redactor/
    └── plugins/
        ├── foo.js 
        └── bar/
            └── bar.js

Other Craft plugins can supply additional Redactor JS plugin locations using the craft\redactor\Field::EVENT_REGISTER_PLUGIN_PATHS event.

redactor's People

Contributors

andris-sevcenko avatar angrybrad avatar arollmann avatar benface avatar benjamindavid avatar brandonkelly avatar carlcs avatar chris78er avatar dependabot[bot] avatar gijsstegehuis avatar johnfmorton avatar kringkaste avatar lindseydiloreto avatar nettum avatar olivierbon avatar saboteur777 avatar steverowling avatar tpmatthes avatar xhmikosr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.