This package contains a number of basic plugins to kick start your Django-CMS project.
Some default to the Twitter Bootstrap look, but can be adjusted using the setting RT_FRONT_END_FRAMEWORK
.
Currently "BOOTSTRAP" and "JQUERY-MOBILE" are recognised.
I use this in conjunction with cmsapp-rt, which gives me a global placeholder for the navbar and
banner pictures, as well as some logic for body padding with a fixed-to-top navbar.
Detailed documentation is in the "docs" directory (pending).
-
Add the desired plugins from cmsplugin-rt to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'cmsplugin_rt.button',
'cmsplugin_rt.facebook_button',
'cmsplugin_rt.button_appstore',
'cmsplugin_rt.google_analytics',
'cmsplugin_rt.google_font',
'cmsplugin_rt.hbar',
'cmsplugin_rt.mailchimp_form',
'cmsplugin_rt.meta_icons',
'cmsplugin_rt.navbar',
'cmsplugin_rt.open_graph',
'cmsplugin_rt.resizeable_picture',
'cmsplugin_rt.self_calc_pagination',
'cmsplugin_rt.spacer',
'cmsplugin_rt.style_modifier',
'cmsplugin_rt.text_minimal_markup',
'cmsplugin_rt.twitter_button',
)
-
If you are using JQueryMobile, add to settings.py::
RT_FRONT_END_FRAMEWORK = "JQUERY-MOBILE" # "BOOTSTRAP" is the default; only these two are known
You can also set this to "" to remove Style Modifier's default Bootstrap class options.
-
To add custom classes to the Style Modifier, add to settings.py something like this::
from django.utils.translation import ugettext_lazy as _
RT_MORE_STYLE_CLASSES = ((".banner", _("banner")),
(".warning", _("warning text")), # example classes only
)
-
The button template is configured for Twitter Bootstrap, although the admin panel shows choices appropriate for
JQueryMobile as well.
If you want to use buttons with JQueryMobile, override the template by adding to your own project the file templates/button_plugin.html
, containing::
{% load allow_special %}
<a data-role="button" {% ifequal instance.button_type "inline" %}data-inline="true"{% endifequal %}
{% ifequal instance.button_size "btn-mini" %}data-mini="true"{% endifequal %} data-ajax="false" href="{{ link }}">
{{ instance.button_text|allow_special }}
{% if instance.arrows %} » {% endif %}
-
Run python manage.py syncdb
(or use python manage.py migrate
if you are using South) to create the models.
-
Add the plugins to your CMS pages in the admin panel.
-
Some plugins use 'spacer', 'align-center', 'align-left', 'align-right' classes, which you should implement in your css, e.g.::
.align-right {
float: right;
}
.align-left {
float: left;
}
.align-center {
margin-left:auto;
margin-right:auto;
text-align:center;
display: block; /* text-align:center and display:block are critical to getting this to work */
}
.spacer {
clear: both;
}