Source

cmsplugin-gallery / docs / configuration.rst

Configuring cmsplugin-gallery

Prerequisites

In order to use cmsplugin-gallery you obviously need to have setup and configured django and django-cms. If you didn't yet, please refer to the Django documentation and the Django-cms documentation.

Required settings

The only required operation in your settings file is to add easy_thumbnails and cmsplugin_gallery to INSTALLED_APPS like this:

INSTALLED_APPS = (
    # you installed applications here
    # ...

    'easy_thumbnails',
    'cmsplugin_gallery',
)

Setting up the database

To set up the tables that cmsplugin-gallery uses you'll need to type:

python manage.py syncdb

Setting up your templates

It is recommended that you add two template blocks in your base template:
  • cmsplugin_gallery_css
  • cmsplugin_gallery_js

For example, your base template could look like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="fr">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Example</title>
    {% block cmsplugin_gallery_css %}{% endblock %}
    {% block cmsplugin_gallery_js %}{% endblock %}
</head>
<body>
    {% block content %}{% endblock %}
</body>
</html>

Available settings variables

You can override the following variables in your settings.py file:

CMSPLUGIN_GALLERY_MEDIA_URL
You can use this variable if you want to set the media url for cmsplugin-gallery to something different from your MEDIA_URL.
CMSPLUGIN_GALLERY_UPLOAD_DIR
The directory where to store cmsplugin_gallery images. Default : uploads/cmsplugin_gallery.
CMSPLUGIN_GALLERY_THUMBNAIL_WIDTH
An integer representing the default width of generated thumbnails in pixels. Default : 80.
CMSPLUGIN_GALLERY_THUMBNAIL_HEIGHT
An integer representing the default height of generated thumbnails in pixels. Default : 80.
CMSPLUGIN_GALLERY_THUMBNAIL_OPTIONS
A list of options for thumbnails generation, please refer to the easy-thumbnails documentation. for an explanation of these options. Default : ['sharpen', 'crop'].
CMSPLUGIN_GALLERY_SHOW_GALLERY_TITLE
Boolean that determines whether gallery title should be displayed in the template or not. Default : True.
CMSPLUGIN_GALLERY_SHOW_GALLERY_DESCRIPTION
Boolean that determines whether gallery description should be displayed in the template or not. Default : True.
CMSPLUGIN_GALLERY_RENDERING_ENGINES
The list of rendering engines, this is explained in details in the :ref:`the customization section<customization>`.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.