Coder Social home page Coder Social logo

execut / djangocms-owl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chapayevdauren/djangocms-owl

0.0 1.0 0.0 1.81 MB

Djangocms plugin for Owl Carousel v1

License: BSD 3-Clause "New" or "Revised" License

Makefile 9.36% Python 79.71% HTML 10.94%

djangocms-owl's Introduction

djangocms-owl

djangocms-owl is a reuseable plugin for django-cms that implements the JavaScript carousel library Owl Carousel. Version 1 of Owl Carousel is supported.

Dependencies

  • Djangocms>=3.0
  • Django>=1.6

Installation

Install Djangocms-owl from Pypi.

pip install djangocms-owl

Add Djangocms_owl to INSTALLED_APPS

INSTALLED_APPS = (
    ...
    'djangocms_owl',
    ...
)

Owl Carousel has a dependency on JQuery Docs that is not currently included within this package. Add a copy will need adding to a template such as the base.html.

<script src="jquery.min.js"></script>

Configuration

CSS classes can be added to the plugin via a select box by using the DJANGOCMS_OWL_STYLES settings tuple.

DJANGOCMS_OWL_STYLES = (
    ('style1', 'Style 1'),
    ('style2', 'Style 2'),
)

djangocms_owl/default.html is rendered by default. The user can select custom templates if the following tuple is set as the example below demonstrates.

DJANGOCMS_OWL_TEMPLATES = (
    ('template1', 'Template 1'),
    ('template2', 'Template 2'),
)

Restrict the plugins available to Owl Carousel

DJANGOCMS_OWL_CHILD_CLASSES = (
    'PicturePlugin',
)

Include or exclude static files

DJANGOCMS_OWL_INCLUDE_CSS = True
DJANGOCMS_OWL_INCLUDE_JS_OWL = True
DJANGOCMS_OWL_INCLUDE_JS_JQUERY = True

Set the CMS module name in the available plugin list. The default is Generic.

DJANGOCMS_OWL_MODULE = _('Generic')

Templates

base.html includes all the JavaScript and CSS needed to run the carousel, but it does not render the HTML. Custom templates can extend base.html as long as they define a plugin block containing the html and plugin render code as show in the below example.

{% extends 'djangocms_owl/base.html' %}
{% load cms_tags %}

{% block plugin %}
  <div class="owl-carousel-plugin plugin{% if style %} {{ style }}{% endif %}" id="plugin-{{ instance.pk }}">
    <div class="row">
      <div class="small-12 columns">
        <div class="slider">
          {% for plugin in instance.child_plugin_instances %}
            <div class="item">
              {% render_plugin plugin %}
            </div>
          {% endfor %}
        </div>
      </div>
    </div>
  </div>
{% endblock plugin %}

Todo

  • Add support for owl carousel 2
  • Expand on the included Owl Carousel configuration options
  • Create abstract base models that can be overridden

Inspiration

Contributions

  • Lee Solway

History

0.1.10 / 0.1.11 BUG Fixes (2016-10-24)

0.1.9 (2016-10-24)

  • Removed South migrations
  • Using the get_render_template method on the plugin
  • Bumping min CMS version to 3.2.3 + Django version to 1.8.1

0.1.8 (2016-04-08)

  • Disabled responsive modes by default, to respect the items option. Options can be overridden in the extra field.
  • When 1 option is selected, singleItem is added to opions by default

0.1.7 (2015-08-06)

  • Migration bugfix

0.1.6 (2015-08-05)

  • Added a JSON field override to allow for custom options
  • Added support for custom CMS module names

0.1.5 (2015-07-22)

  • Static files included from bower
  • Included jQuery
  • Included v2 of Owl Carousel of later user
  • Added settings to include/include jquery, owlcarousel.js and owl*.css files
  • Re-added select_template with Django 1.8 support
  • Separated the template to include a base to facilitate custom template creation - e.g. extend base.html

0.1.4 (2015-07-17)

  • render template bug fix with Django 1.8 (removed select_template)

0.1.3 (2015-07-06)

  • Critical bug fix

0.1.2 (2015-07-06)

  • Converted README.md to README.rst
  • Added AppConf
  • Added DJANGOCMS_CHILD_CLASSES configuration option
  • Updated the initial Django migration dependency to CMS 0001 initial

0.1.1 (2015-07-05)

  • Documentation updates

0.1.0 (2015-07-03)

  • First release on PyPI

djangocms-owl's People

Contributors

leejp74 avatar leesolway avatar

Watchers

 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.