Skip to main content

CastleCMS Plone distribution main package

Project description

.. image::
:height: 50
:width: 382
:alt: Original work by
:scale: 50 %

For access to Castle Cloud (our hosted CastleCMS service) or to request customizations or demos, please contact us at or

+1 (715) 869-3440

Welcome to the main CastleCMS package!

Feature List

In addition to Plone standard features, CastleCMS includes:

- Login/lockout support
- Content archival to Amazon S3 storage
- Large files automatically moved to S3 storage
- Redis cache support
- Advanced content layout editor
- Improved management toolbar
- Intuitive content creation and organization
- Elasticsearch integration
- Search results tuned by social media impact
- Search results pinning
- Celery task queue integration (asynchronous actions)
- PDF generation
- Video conversion
- Amazon S3 interaction
- copying and pasting of large batches of items
- deletion and renaming of large batches of items
- Advanced content tiles:
- maps
- videos
- audio
- sliders
- galleries
- table of contents
- Audio and video content
- Automatic conversion of videos to web compatible format
- Search weighting based on popularity using Google Analytics API
- Content alias management
- Disqus commenting integration
- reCAPTCHA integration
- fullcalendar integration
- Google Business metadata
- Emergency notification system with optional SMS support
- Preview content on a variety of device sizes
- Map content
- KML feeds
- Social media integration with Twitter, Facebook, Pinterest
- Etherpad collaborative spaces support
- Stripping metadata from files
- Ability to view the site as another user
- Audit log, user activity reports
- Session management, inspection and termination
- Analytics dashboard
- De-duplication of uploaded images and files
- Trash can / recycle bin
- Two factor authentication


This package includes a lot of customizations to default Plone and, without an installer,
getting it running is a bit tricky.


- Redis
- avconv (needs to be updated for ffmpeg again)
- ElasticSearch 2.3

Development setup on macOS

1. ``brew install redis elasticsearch libav python``
2. ``git clone``
3. ``cd castle.cms``
4. ``virtualenv -p python2.7 .``
5. ``bin/pip install --upgrade pip``
6. ``bin/pip install -r requirements.txt``
7. ``bin/buildout``
8. Run (in separate terminal windows) ``elasticsearch``, ``redis-server``, ``bin/instance fg`` and ``bin/celery worker``
9. Browse to http://localhost:8080/

Optional Dependencies

- Install `argon2_cffi` to use more secure password hashing.
- for faster search integration
- Amazon S3 credentials to store large files on S3
- Google API keys for Google analytics and Recaptcha integrations
- Plivo API for SMS

Running tests

Assuming you have buildout properly installed to run the tests:

.. code-block:: shell

Xvfb :99 &
Xvfb :99 -fp /usr/share/X11/fonts/misc -screen 0 1900x1900x24 &
export DISPLAY=:99

To access the running Selenium test server on port 55001:

.. code-block:: shell

ZSERVER_HOST= ./bin/test -s castle.cms

To specify a custom Firefox binary to match versions:

.. code-block:: shell

FIREFOX_BINARY=/opt/firefox/firefox ./bin/test -s castle.cms

If Selenium refuses to start, update the binaries:

.. code-block:: shell
pip install -U selenium

If it still doesn't run, attempt to install Firefox 45

Non-Selenium tests:

Since Selenium can be flaky...

.. code-block:: shell

./bin/test -s castle.cms -t \!selenium

Google Analytics Key File

- go to the Google API console
- create new credentials
- service account
- p12
- enable Analytics API api for credentials
- fill out email with email provided and p12 file in CastleCMS API settings
- use email for email you want to access and add it as an authorized user for the account in Google Analytics

Cron jobs

CastleCMS uses many cron jobs that need to be setup.


- ``bin/clean-plone-users``: removes disabled users
- ``bin/clean-plone-users``: removes disabled users
- ``bin/clean-plone-users``: removes disabled users
- ``bin/clean-plone-users``: removes disabled users
- ``bin/social-counts``: goes through all content and updates social media counts. Can be done monthly
- ``bin/content-popularity``: if Google Analytics is setup, will get content statistics for popularity


- ``bin/archive-content``: Archive content and send out warnings about content that will be archived
- ``bin/empty-trash``: Delete items that have been in trash for 30 days
- ``bin/send-forced-publish-alert``: Send update to admins about content that was forced-published


- ``bin/twitter-monitor``: Monitor Twitter for mentions of your site


CastleCMS provides a simple export/import mechanism that does not use transmogrifier.

You are still able to build your own custom transmogrifier pipelines to import/export
into CastleCMS; however, our scripts work in a lot of cases to get your
content moved over quickly.


Copy the export script into your existing site's main buildout folder::

Then, to run the export script::

./bin/client1 run --site-id=mysiteid --dir=./export

where "client1" is a ZEO client of your site and "mysiteid" is the
ID of your Plone site.

To customize the export script so only parts of the site are exported,
you can change the final line in the script to a custom catalog query that
pulls in only the content you want to export.


Start by copying the exported directory (that you created in the previous step) to
the CastleCMS installation folder.

Next, copy the import script into your new CastleCMS site's main buildout folder::

Then, to run the import script::

./bin/client1 run --site-id=mysiteid --export-directory=./export

where "client1" is a ZEO client of your site and "mysiteid" is the
ID of your CastleCMS site.

To register your own import type, using Event as an example::

from castle.cms._scripts.importtypes import BaseImportType
from castle.cms._scripts.importtypes import register_import_type
from castle.cms._scripts.importtypes import DateTime_to_datetime

class MyImportType(BaseImportType):
fields_mapping = {
# list of original field names to new field names
# 'startDate': 'start'
data_converters = {
# field name -> func(val) -> val
# convert data to the format it should be
# 'start': DateTime_to_datetime,
behavior_data_mappers = (
# (Behavior Interface, field name)
# to set behavior data from export data...
# (IEventBasic, 'start'),

def post_creation(self, obj):
Additional custom data migration after object is created
super(MyType, self).post_creation(obj) = 'bar'

register_import_type('MyType', MyImportType)

Tile display types

There are tiles provided by CastleCMS that allow you to customize
the display type. The display type field is a way of providing a different
view of the content.

Available display type tiles include the following (along with the matching display type vocabulary ID):

- Navigation (navigation)
- Existing content (existing)
- Gallery (gallery)
- Query Listing (querylisting)

Providing your own display types

There are 3 components to registering a display type for a tile:
- Display type class
- Page template
- ZCML registration

Example custom display type

Here is an example of creating a custom display type for the existing content tile.

Define the display type class::

class MyTileView(BaseTileView):
name = 'myview'
preview = '++plone++castle/path/to/image.png'
order = 1
index = ViewPageTemplateFile('')
tile_name = 'existing'

Then define the template::

<tal:wrap tal:define="utils view/tile/utils;
data view/tile/data;
df view/tile/display_fields;
idt data/image_display_type|string:landscape;
existing nocall: view/tile/content|nothing;
url python: utils.get_object_url(existing);
has_image python: 'image' in df and utils.has_image(existing);">
<h3><a href="${url}">${existing/Title}</a></h3>

Finally, define the ZCML to register it::

for="plone.dexterity.interfaces.IDexterityContent castle.cms.interfaces.ICastleLayer"

Lead images

- all content has lead images
- lead images can be references to other images on the site or to other content on the site that has a lead image

CastleCMS upgrades

There is currently no UI in the Site Setup to run CastleCMS

To run upgrades::

- go to the Management Interface (/manage) for your site
- click on portal_setup
- click the "Upgrades" tab
- select "castle.cms:default" and click "choose profile"
- from here, you should get a list of available upgrades to run

After the Deadline Spellchecking

CastleCMS includes Plone's TinyMCE support for After the Deadline spellchecking and::

- supports After the Deadline in rich text tiles
- integrates spelling/grammar check within the content quality check dialog

To use After the Deadline, go to Site Setup and configure After the Deadline in the
TinyMCE configuration panel.


2.0.45 (2018-07-13)

- add Event start and end datetimes to the query listing tile's views

- add Site Crawler control panel field descriptions

- check for when Twitter-related keys in twitter-monitor

- Added Beautifymarkers leaflet extension, adds map icon customization

- add celery environment vars for connecting to redis

- Added fragments directory ZCML directive

- Add Survey invite tile and controlpanel

- Replace deprecated 'mockup-patterns-base' with 'pat-base' in several files

2.0.44 (2018-05-08)

- fix default news item layout

- add description to Etherpad fields

2.0.43 (2018-04-06)

- Add simple display type to existing content tile (displays body of article)

- show relative and absolute datetimes in contents view

- change default site announcement text

- Change email category widget. Make subscribe title editable. Updated to work with Plone 5.0.x

2.0.42 (2018-03-01)

- tweak tour text

- fix CastleCMS spelling

- tweak installation instructions

- add version pins

- remove duplicate location of site announcement settings

- correct typos; add descriptions to control panels

- improve URL shared via sharing buttons

2.0.41 (2017-09-26)

- print.css improvements

2.0.40 (2017-09-26)

- accessibility and print.css improvements

2.0.39 (2017-09-20)

- 2-level nav improvements for mobile

2.0.38 (2017-09-18)

- Fixed the missing print stylesheet

2.0.36 (2017-08-01)

- Fixed issue breaking the history view on content

2.0.35 (2017-07-26)

- Added in a 2 level navigation

2.0.34 (2017-07-03)
- Changed map attribution string to include OpenStreepMap

- Fixed problem breaking content history view

- add new CastleCMS pypi classifiers

- Added a toolbar button to allow users to manually mark an object for archiving

2.0.33 (2017-05-8)

- Site install now wont add duplicate slot tiles

- Original image scale now actually does something

2.0.32 (2017-04-28)

- Better error pages with stacktrace info if it's possible to provide

- Be able to modify comments made on a historic content object history data

- Fix 404 not being protected by login shield.

- After login should now redirect you to `/@@dashboard` or to the original
url you requested if you were redirected to login page

- Updated defaults for the image tile

2.0.31 (2017-04-18)

- Fix version pin for to work correctly with folder contents
and changing date properties

- Build css/js with latest mockup but disable now/clear buttons on pickadate
so they are unstyled and look bad with castle.

- Fix password reset template to send user's username instead of id

- now works to export dexterity and mosaic pages

- fix crawling gz sitemaps

- Resolved issue where the the words 'site settings' showed up when clicked

2.0.30 (2017-04-12)

- Fix create user to send out correct password reset url

- Handle issue getting current user when logging in. Can happen with authomatic

- fix cases where generated absolute url was incorrect based on the original
result html not being used for the base path

- Resolved issue where invalid sort parameters broke the querystring tile. Closes issue #42

- Resolved issue where the images were missing due to the url being wrong. Closes issue #17

2.0.29 (2017-04-04)

- Change "Read transcript" link to "Transcript | Download"
- Fix issue where a span tag was being added to the castle toolbar which is an accessibility issue.
- Fix accessibility issue of not having words in the cog button. The screen reader needs to read something.

2.0.28 (2017-03-28)

- Use ssl for maps data urls

2.0.27 (2017-03-27)

- Fix issue where archetypes content in castle.cms would cause potentially
inconsistent search results.

2.0.26 (2017-03-27)

- Fix potential issue with upgrading to latest version of collective.elasticsearch

2.0.25 (2017-03-27)

- Fix regression from login fix

2.0.24 (2017-03-27)

- Do not require selection of images for gallery/slider tile so that query
field will work

2.0.24 (2017-03-27)

- Fix cron scripts to look in more locations for zope.conf

2.0.23 (2017-03-27)

- Be able to provide dynamic query for gallery and slider tiles

- Fix issue where feature tile was not mobile friendly

- Provide link back to original image item from slider/gallery tiles

2.0.22 (2017-03-27)

- Fix case where query results would not correctly get results when using the filter.

2.0.21 (2017-03-24)

- Fix some cases where default plone workflow was assumed

2.0.20 (2017-03-24)

- Be able to specify external url for the image tile.

2.0.19 (2017-03-23)

- Fix case where default page would not be imported correctly on some sites. By
default import will always attempt to treat a lead image for folder content.

2.0.18 (2017-03-22)

- Make AtD support work with mosaic rich text tiles

- Integrate AtD with quality check. If active, quality check will also notify
potential spelling/grammar issues.

2.0.17 (2017-03-22)

- Fix issue where empty lead images would get imported from old lead image package
and no filename would be found.

2.0.16 (2017-03-21)

- Fix event type to have lead image and search customization

- Fix import of event type

2.0.15 (2017-03-21)

- Fix OFS missing import in importtypes

- JSON feed now works with body option

2.0.14 (2017-03-20)

- Provide information on lead image when inspecting history

- Handle zeoserver errors for syndication

2.0.13 (2017-03-20)

- Fix invalid date issue from crawled pages on search results page

- auto detect lead images from content in the layout

2.0.12 (2017-03-15)

- Fix paste button not working and throwing unauthorized errors because of
missing csrf token. Fixes #19

- Automatically detect image in content if no lead image is set. Fixes #28

- Fix showing non-image content on lead image browse selector. Fixes #30

- Be able to provide additional views for the existing content tile

- Be able to specify upload location

2.0.11 (2017-03-09)

- Fix image focus point upgrade issue where it would request more images than
it should

- Provide image_url for json feed

- If commenting enabled on a folder, it will become the default for all children
in that folder.

2.0.10 (2017-02-06)

- Fix next/prev nav fragment to work with pages and site root

- Fix fullcalendar issue with selecting text when one is dropped on page.
This requires building with mockup on fix-jquery-event-drag-compat branch
or master once it's merged

- Override default Zope2 logging to log actual plone username in Z2.log

2.0.9 (2017-01-23)

- Add automatic session refresh support

2.0.8 (2017-01-21)

- Be able to provide your own google maps api key so that working with the
mapping widget works more consistently.

- Use argon2 pw encryption scheme by default

2.0.7 (2017-01-18)

- Fix previous release

2.0.6 (2017-01-18)

- Fix logged in event not recorder in the audit log correctly

2.0.5 (2017-01-18)


- Add new JSON feed type


- Fix parsing querylisting selected-year query

- Fix parsing querylisting Title/SearchableText query

2.0.4 (2017-01-09)

- add rocket chat integration
[sam schwartz]

- fix issue where password reset wasn't sticking

- make sure logout page shows login form

- add clean-drafts script

- add ping draft view so that the clean-drafts script knows not to clean a potentially
active draft

2.0.3 (2016-12-20)

- Be able to pass in a site object to the render_content_core function for
layout aware items

2.0.2 (2016-12-14)

- build resources

2.0.1 (2016-12-14)

- fix ipod/ipad safari video background image issue

2.0.0 (2016-12-07)

- Initial public release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
castle.cms-2.0.45.tar.gz (6.3 MB) Copy SHA256 hash SHA256 Source None Jul 13, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page