README.rst

cmsplugin-text-ng

An enhanced version of the Text plugin for django CMS. It allows wrapping
the text plugin inside a template selectable by the CMS content editor.

Note

This plugin is not meant to replace cms.plugins.text. It is an
enhancement for certain use cases. For most types of content, you should
probably still use cms.plugins.text or write a specifically tailored
plugin.

Installation

Add cmsplugin_text_ng to your INSTALLED_APPS.

Create some templates (more on that soon) and add them in the admin.

Basic example: static template

Let's say you want to have a text plugin with a facebook "like" button. Your
template could look something like this:

When you edit the plugin, you will now have a text box with the "h2_content" as
a label. Its content will be added to the context when rendering the plugin. You
can access it like any context variable: {{ h2_content }}.

The as text part of the template tag refers to the type of the variable.
cmsplugin-text-ng comes with one type (text). Additionally, there is an
image type in cmsplugin_text_ng.contrib.textng_filer that uses
django-filer to add images to the template context. If you want to use it,
make sure that both filer and cmsplugin_text_ng.contrib.textng_file are
listed in your INSTALLED_APPS.

Really (just kidding) advanced example: define your own types

So, you want to add some HTML code right below the "like" button, and your
content editors insist on using TinyMCE. Let's do this! Using the awesome
HTMLField from django-tinymce, we set up a model with a tinymce'd
textarea: