Stackable Plugins are a set of Django CMS plugins to make it easy for content managers to build somewhat custom pages.
They fall into two broad categories:
- Page Framework plugins - where you can create grids of content;
- Custom Function plugins - these are a loose library of plugins that were created for past projects.
-
Each plugin has one or more renderers. This allows the content to be rendered/displayed in different ways. For example a generic list that contains callouts with an image, title, and short description, can be rendered as a list, in a grid, in a slideshow, or in a carousel (or in any other way your designer might dream up!), but the content is the same. You can switch between renderers on the fly!
-
You can add renderers to any plugin.
-
Some plugins (like the Generic Container) can have children plugins.
-
Install and set up Django CMS
-
Add "stackable_plugins" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [ ... 'stackable_plugins', ]
-
Run
manage.py migrate stackable_plugins
These allow you to "frame out" the content within a page's placeholder.
Fundamentally, this is just a box of other plugins. It's a way to segregate content on the page when you need that content treated as a group.
This is a wrapper for a list of curated content. The items in the List do NOT have to be of the same type: you can create a list with an Image, a Video, then a blob of text, then another Video, then a List within the List, etc.
This is a way to make fancy content separators (the most generic of which is the <hr>
tag).
Typically this is used with a separator image.
Why have a link when you can have a button?
These are very customizable!
- Links can be External or Internal OR to a File (e.g., a PDF File);
- The link target can be to a new window, etc.;
- You can use any custom CSS class to render the generic button;
- You can set attibutes on the button (colors, etc.)
These plugins have more structured content but have somewhat generic functions: e.g., a video player that can be used for YouTube, PBSMM, Vimeo, etc.
This plugin has an Image plus additional commonly-used metadata:
- main image (with height and width)
- thumbnail image (with height and width)
- caption text (can be HTML content)
- credit/copyright text
Note that the thumbnail image and the main image do not have to be the same (i.e., that the thumbnail is just a resized version of the main image).
This is a generic video container. Each video is attached to a HostService (e.g., YouTube, Vimeo, etc.) and has a unique ID at that service, plus additional metadata:
- Title
- Duration
- Description
These plugins were created for past projects.
Biography container with headshot, byline, and bio.
Displays the time until a future date/time.
Fields available:
- t_minus = time as a
datetime.timedelta
(days, seconds, microseconds) - total_seconds = "How many seconds are left?"
- in_the_past = "are we past the deadline"
- t_minus_days, t_minus_hours, t_minus_minutes, t_minus_seconds = the time left so you can format is as 3d 14h 32m 06s if you wanted to
- unixtime = the countdown "zero point" expressed as a UNIXTIME (e.g., 1550762809) - useful for some Javascript libraries (see below).
- unixtime_now = the time of the page load as a UNIXTIME
Note that this plugin does NOT include the functionality to provide a real-time counting down. For that you'd need to install a Javascript library and create a custom renderer (see below) to run it, using some of the fields above to "seed" it. (There are several different JS libraries for this out there.)
This basically allows for a side-by-side comparison of two things, e.g., "Let's Compare Wolverine vs. Cyclops".
You can create your own renderers for any of these plugins.
In your settings.py
file, you need to add the ADDITIONAL_PLUGIN_RENDERER_TEMPLATES
dict. It has the following format:
ADDITIONAL_PLUGIN_RENDERER_TEMPLATES = {
'GenericButtonPlugin':
[
( 'my_special_button',
'Special Button',
'foo_templates/special_button.html',
'Use this renderer if you want things to be REALLY special.'
),
],
}
Each key in ADDITIONAL_PLUGIN_RENDERER_TEMPLATES
is one of the custom plugins. The value is a list of tuples, each of which is a renderer for that plugin. So you can create as many as you'd like.
The tuple has 4 items:
- The slug for the renderer;
- The title (shown on the renderer dropdown when you're using the plugin);
- The location of the rendering template;
- Some descriptive help text about how this renderer works.
At present you can't remove any of the built-in renderers.
TBD.
TBD.
TBD.