Giter VIP home page Giter VIP logo

djangocms-unitegallery's Introduction

djangocms-unitegallery

image

image

image

image

image

image

A gallery plugin for django CMS that uses the excellent Unite Gallery jQuery plugin.

Installation

This plugin requires django CMS 3.0 or higher and sorl-thumbnail 12.0 or higher to work.

  • Run pip install djangocms-unitegallery
  • Add 'sorl.thumbnail' and 'djangocms_unitegallery' to your INSTALLED_APPS
  • Run python manage.py migrate

Note

It's up to you to include jQuery js file in your templates, just make sure you include it before the sekizai {% render_block js %}.

Configuration

By default djangocms-unitegallery generates thumbnails for better perfomance. The default behavior is to generate thumbnails by resizing and cropping images in a square of 250x250 px.

You can disable completely the thumbnail generation and leave Unite Gallery handles images and preview, or you can change the default size of generated thumbnails and/or wether the image ratio should be preserved or not:

DJANGOCMS_UNITEGALLERY_CONFIG = {
    'THUMBNAIL_ENABLED': true,
    'THUMBNAIL_MAX_WIDTH': 250,
    'THUMBNAIL_MAX_HEIGHT': 250,
    'THUMBNAIL_PRESERVE_RATIO': False, 
}

If you set THUMBNAIL_PRESERVE_RATIO to False, thumbnails will be cropped to match the configured width and height. If you set THUMBNAIL_PRESERVE_RATIO to True, thumbnails will just be resized to match the configured max width (if image is landscape) or height (if image is portrait).

Note

Due to Unite Gallery behavior, and depending on configured options, you are not guaranteed to have the thumbnail size you configured in settings.

djangocms-unitegallery's People

Contributors

izimobil avatar rjhelms avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.