Giter Club home page Giter Club logo

statamic-ckeditor's Introduction

Statamic CKEditor add-on

This is a CKEditor fieldtype add-on for Statamic.

Customised CKEditor field

It has been tested with Statamic v1.7.1.

Important

This fieldtype clashes with the Redactor fieldtype. Once you have installed it and use a Redactor field, the field will show the CKEditor toolbar on field focus.

I made this add-on to replace Redactor, so this is not an issue for me. If you want to keep using Redactor in your publish forms, feel free to put on your de-bugging pants and dive into the code to fix this. Do please let me know of the solution when you come across it :)

Installation

Upload the ckeditor folder to your Statamic's _add-ons folder.

Configuration

By default the editor comes with the whole shebang of toolbar buttons. If you dislike red and yellow highlighted text as much as me and don't want your client going editing crazy, you'll probably want to change this.

Open _add-ons/ckeditor/config.js and refer to lines 12 - 20 and lines 24 - 43. They contain examples of how you can customise the styles dropdown and the available buttons in the toolbar. Uncomment them, change them, delete them - the editor configuration world is your oyster!

Refer to the CKEditor documentation for more help and options.

Browsing and uploading files or images

If you want to allow users to add links to files or to add images to the text, you can use the Filemanager add-on.

Once you have that installed and configured, open _add-ons/ckeditor/config.js and uncomment the code on lines 47 and 48.

Running in a subdirectory

If you are running Statamic in a subdirectory, follow these steps:

  1. Open _add-ons/ckeditor/config.js.
  2. Add your subdirectory to the CSS path on line 7.
  3. If you are using Filemanager, add your subdirectory to the file browsers paths on lines 47 and 48.

Declaring a CKEditor fieldtype

Declare type: ckeditor in your fieldset settings.

To do's

  • Enable field settings for a basic/complex toolbars and width/height declarations

statamic-ckeditor's People

Stargazers

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

Watchers

 avatar  avatar

statamic-ckeditor's Issues

Resize image inside CK Editor

Hi Katrin.

Is it somehow possible to add the redactor resizing option in ckeditor:

resize:
    width: 500
    height: 300
    quality: 60
    upsize: false

That would be awesome.

Latest version of ckeditor

Hi,
I upgraded the ckeditor files to 4.4.2 and everything still seems to be working. This means I can use the figure and figcaption stuff that comes with their Image2 (Enhanced Image) plugin and also use the disallowedContent feature which is very useful for removing things like image width and height attributes. Your config file still works with this version. Maybe give it a go and upgrade?
Thanks again.

Titles not saving

Excellent work on this plugin :)

However, I have noticed that titles are not being saved in the .md file.

For example:

#2013-04-27-ck-editor-test.md

---
    <-- [Title is missing ]

---
<p>Test</p>

Hope this makes sense!

css Issue on publish page when ckeditor is added.

Hi.

in ckeditor/contents.css on the line 6 is a declaration which affects the admin panel theme:

body
{
    /* Font */
    font-family: sans-serif, Arial, Verdana, "Trebuchet MS";
    font-size: 12px;

    /* Text color */
    color: #333;

    /* Remove the background color to make it transparent */
    background-color: #fff; // This adds a white background to the whole admin panel

    margin: 20px; // This adds a Margin to the whole admin panel
}

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.