Code Monkey home page Code Monkey logo

craft-3-froala-wysiwyg's Introduction

Froala WYSIWYG editor for Craft CMS (v3)

The implementation of the Froala Editor (license not included) for Craft CMS (v3)

Check the Craft CMS v2 version here

Entry Field Example

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 "Froala". 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

# tell Composer to load the plugin
composer require froala/craft-froala-wysiwyg

# tell Craft to install the plugin
./craft install/plugin froala-editor

Known issue (help wanted!)

Adding links to Craft Entries causing issues when you double click on the entry to link to. Just click once and use the "Select" button.

Sorry for the inconvience. We're working on these annoying issues. But we decided to release a new version because of some missing important other features (like saving links the Craft way).

Configuration

Froala Configs

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

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

{
  "toolbarButtons": [
    "bold", "italic", "underline", "strikeThrough", "formatOL", "formatUL", "insertHR", "|",
    "undo", "redo", "|", "paragraphFormat", "paragraphStyle", "|", "html"
  ],
  "paragraphFormat": {
    "N": "Normal",
    "H1": "Heading 1",
    "H2": "Heading 2",
    "H3": "Heading 3",
    "H4": "Heading 4"
  }
}

…then a "Simple" option would become available within the config section on your Froala field’s settings.

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

Third party plugins

<!-- Include third party plugins -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<script src="../../js/third_party/font_awesome.min.js"></script>
<script src="../../js/third_party/spell_checker.min.js"></script>
<script src="../../js/third_party/embedly.min.js"></script>
<script src="../../js/third_party/image_tui.min.js"></script> 
<link rel="stylesheet" href="../../css/third_party/image_tui.min.css">

HTML Purifier Configs

Froala 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 Froala fields. They should be created as JSON files in your config/htmlpurifier/ folder.

Use this as a starting point, which is the default config that Froala fields use if no custom HTML Purifier config is selected:

{
    "Attr.AllowedFrameTargets": ["_blank"],
    "Attr.EnableID": true,
    "HTML.AllowedComments": ["pagebreak"]
}

(The HTML.AllowedComments option is required for the pagebreak plugin.)

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

Contributing

If you have any issue regarding the editor itself, please report your issue on the main repository itself.

You can raise an issue here if you have found a problem in the integration with Craft CMS v3.

If you already have fixed the bug yourself, please create a Pull Request (PR) and send us the fixes with a detailed description of the problem and the fix. Please PR your changes on our develop branch.

Any help will be appreciated. Many thanks.

License

To enable the editor correctly, you should have a purchased a license on www.froala.com.

Once you have a license, for your domain, you can enter the license key in the plugin settings.

craft-3-froala-wysiwyg's People

Contributors

brandonkelly avatar froala-travis-bot avatar harasunu-narayan avatar jiteshgupta1995 avatar kapil2704 avatar reganlawton avatar singhmonaaccolite avatar zae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

craft-3-froala-wysiwyg's Issues

Froala editor settings config file per field

It should be possible to set/override the configuration made in JSON files inside the config/ folder for each field. Currently this can only be done for the plugin overall, for all fields.

Unable to install

Installing this plugin takes down the entire back end of Craft, with the error: Call to a member function getSettings() on null. Removing the plugin brings the site back. Happy to send logs if you need

Screen Shot 2019-04-18 at 4 25 09 PM

Table previews are not displaying correctly

Table previews in the Control Panel are not displaying correctly:

Screenshot_2020-06-15 Test Page - Southend-on-Sea Borough Council

I created an issue with Craft CMS at first, but they said this is not something they are willing to resolve right now.

Additional info

  • Craft version: Craft CMS 3.4.23
  • PHP version: 7.3.16
  • Database driver & version: MySQL 5.7.29
  • Plugins & versions: Froala 3.1.0

toolbarSticky not working

It seems that the sticky toolbar doesn't work. This is quite annoying for large content snippets. Do we have a fix of work around for it?

Custom Craft plugins (Asset and Entry/URL selection) not working with Froala v3 and v4

As far as I've been able to reproduce the Craft plugins for the editor itself ,including media asset selection and selecting entries using the link plugin, have never been updated to support Froala v3 and v4 respectively, while this repo has been receiving major version bumps for that package.

It appears to still be using the v2 jQuery-based API, and is throwing errors in the browser console due to that API no longer functioning with the Froala version included with this Craft plugin.

See #20 and #19 for basic functionality breaking due to this problem.

Craft 4 Support

Is there a timeline on when this plugin will be updated to support Craft 4?

Uploaded images not saving

I'm trialing this plugin, thus I haven't activated a full license yet. However as I understand it, full functionality should still be available.

This is my field configuration:

Screenshot 2020-03-16 at 15 41 23

I can see that the folders get created in my Froala Content Asset Volume, but no images are saved.

Screen recording here: https://cloud.roberttolton.com/o0uDGLLW

You can see after the page refreshes (doing a save-and-continue), the image is gone.

If i disable the HTML Purifier, then some HTML for the images is saved - however the source of the image is a BLOB URL.

This plugin is not displaying all the Froala Plugins

Hi, is anyone here having issues with the plugins configurations ?

I attempted to enable/disable them on the Settings / Plugins / Froala / Plugins but I am not able to enable "insertTable"

I also attempted to create a config/froala/Basic.json as provided in the documentation, selected this config file as the default config file in Settings / Plugins / Froala. But the contents of this file are not taking effect in the Editor view (tried with toolbarButtons, toolbarButtonsMD, toolbarButtonsSM...)

YouTube embed stripped out with HTML Purifier is on.

Recently integrated the WYSIWYG editor into my Craft instance to test out the features.

It seems that when embedding a youtube video, the video is stripped out. This only happens when the HTML purifier is on however, and happens with both URL and embed code.

Image and File sources are not properly configured for this field.

I keep getting this error, not idea what I'm doing wrong, I supplied a images and files folder.

Image and File sources are not properly configured for this field.

Am I doing something wrong or isn't the plugin updated for craft 3.1 yet?

froala/craft-froala-wysiwyg (2.9.2)
craftcms/cms (3.1.8)

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.