Giter VIP home page Giter VIP logo

collective.ckeditor's Introduction

This addon is a ckeditor integration for Plone.

You can install it as any Plone addon. Please follow official documentation.

Please use CKeditor for Plone > 3.

The code source can be found at https://github.com/collective/collective.ckeditor

Please report issues at https://github.com/collective/collective.ckeditor/issues

Go to ZMi-->portal_setup-->Upgrades, choose "collective.ckeditor:default" profile and execute the upgrade steps.

Release 4.3.0 comes with the Enhanced Image plugin (image2). It is not enabled by default as it removes some of the advanced functionality provided by the default image plugin (image). However, the Enhanced Image plugin provides the ability to add a caption together with the image. It is also much more user-friendly.

To enable the plugin, you need to setup ckeditor_properties through generic setup propertiestool.xml:

<?xml version="1.0"?>
<object name="portal_properties" meta_type="Plone Properties Tool">
 <object name="ckeditor_properties" meta_type="Plone Property Sheet">
  <property name="removePlugins" type="lines">
   <element value="image"/>
  </property>
  <property name="plugins" type="lines">
   <element value="ajaxsave;/++resource++cke_ajaxsave/plugin.js"/>
   <element value="image2;/++resource++ckeditor/plugins/image2/plugin.js"/>
  </property>
 </object>
</object>

This disables the image (default) plugin and enables the image2 plugin.

The image2 plugin comes with two specific settings (configurable only through generic setup):

<?xml version="1.0"?>
<object name="portal_properties" meta_type="Plone Properties Tool">
 <object name="ckeditor_properties" meta_type="Plone Property Sheet">
  <property name="image2_captionedClass" type="string">image</property>
  <property name="image2_alignClasses" type="lines">
   <element value="image-left"/>
   <element value=""/>
   <element value="image-right"/>
  </property>
 </object>
</object>

The settings are image2_captionedClass and image2_alignClasses. The values above are the default values.

If you enable the plugin, you also need to setup Plone to accept the figcaption tag.

This is done by configuring HTML filtering with a setup handler like:

def enable_figcaption(p):
    """ Allow figcaption as valid tag in portal_transforms safe_html"""

    from Products.PortalTransforms.Transform import make_config_persistent

    pt = getToolByName(p, 'portal_transforms')
    tid = 'safe_html'
    if not tid in pt.objectIds():
        return
    trans = pt[tid]
    tconfig = trans._config

    validtags = tconfig['valid_tags']
    validtags.update({'figcaption': 1})

    make_config_persistent(tconfig)
    trans._p_changed = True
    trans.reload()
    log.info('added figcaption as valid tag')

Attention!

ConfigurationError

If you try to run a Zope/Plone instance with a collective.ckeditor checkout, your instance will break with a ConfigurationError:

Directory .../browser/ckeditor does not exist.

After checking out collective.ckeditor sources, run the included buildout.

This installs and runs the copy_ckeditor_code script. It takes care of copying ckeditor code in the appropriate browser/ckeditor directory.

The browser/ckeditor directory makes ckeditor javascript code available to the browser at:

http://yourplonesite/++resource++ckeditor/

Obviously, the ckeditor code also needs to be included in the released eggs.

collective.ckeditor registers an entry point for zest.releaser that (if called properly) takes care of copying the code when preparing the release.

However, in order to take advantage of the entry point, you have to use the bin/fullrelease locally installed by the development buildout instead of a globally installed fullrelease.

Only the local bin/fullrelease script can see the entry_point registered by collective.ckeditor.

Valid for CKEditor 4

  1. Go to http://ckeditor.com/builder

  2. Choose preset Full

  3. Do not modify included plugins.

  4. Select skin Moono color

  5. Click Add all link beside Languages to choose label

  6. Agree with the terms ;-)

  7. Download CKEditor

  8. Unzip archive

  9. Replace all content of src/collective/ckeditor/_src/ckeditor directory with the contents of ckeditor 4 directory from the archive.

  10. Download and install image2 plugin and its dependencies in src/collective/ckeditor/_src/ckeditor/plugins directory. In June 2014, they are found at:

  11. Run bin/copy_ckeditor_code

  12. Test

https://secure.travis-ci.org/collective/collective.ckeditor.png

collective.ckeditor's People

Contributors

macadames avatar gotcha avatar gbastien avatar kiorky avatar encolpe avatar toutpt avatar mauritsvanrees avatar spereverde avatar giacomos avatar dokai avatar vincentfretin avatar cedricmessiant avatar taito avatar sneridagh avatar montypie avatar tdesvenain avatar

Watchers

James Cloos 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.