Code Monkey home page Code Monkey logo

djangocms-light-gallery's Introduction

django CMS Light Gallery

PyPI version

django CMS plugin for Light Gallery 1.4.0

Example light gallery using default settings

Installation

First, add djangocms-light-gallery to your requirements.txt or install the plugin

pip install djangocms-light-gallery

Then add the plugin to settings.py

INSTALLED_APPS = [
  // ...
  'light_gallery',
  // ...

Run the migrations

python manage.py migrate light_gallery

This plugin relies on javascript, ensure you have a js block in your template

{% render_block "js" %}

Should now see Light Gallery as a component in django CMS

djangocms-light-gallery's People

Contributors

alireza2n avatar andyklimczak avatar peterfarrell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

djangocms-light-gallery's Issues

No setting for vertical margin?

Hi Andy, first of all thanks for the great plugin. It's very simple to setup! However, I have one question. Is there a setting for spacing between rows of the gallery?
lightgalleryexample
As you can see, there is no spacing between images, which makes things look a bit crowded.

Main picture missing in gallery view

Thank you for the great work on djangocms-light-gallery. Integrating the gallery into a djangocms project was much easier than I expected!

However I encounter one issue that I am not able to resolve: The main picture in gallery view is missing while thumbnails are displayed nicely. My browser returns the following error message:

Page not found (404)
Request Method:     GET
Request URL:    http://mysite.com/en/mysubpage/filer_public/.../mypicture.jpg/
Raised by:  cms.views.details

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

    en/ ^jsi18n/$ [name='javascript-catalog']
    ^static/(?P<path>.*)$
    en/ ^admin/
    en/ ^ ^cms_login/$ [name='cms_login']
    en/ ^ ^cms_wizard/
    en/ ^ ^(?P<slug>[0-9A-Za-z-_.//]+)/$ [name='pages-details-by-slug']
    en/ ^ ^$ [name='pages-root']
    en/ ^ ^$ [name='home']
    en/ ^sitemap\.xml$
    ^media/(?P<path>.*)$

The current path, /en/mysubpage/filer_public/.../mypicture.jpg/, didn't match any of these.

It seems that the URL of the picture is not parsed correctly. Instead of the correct location (https://mysite.com/media/filer_public/.../mypicture.jpg/) the source code contrains https://mysite.com/en/mysubpage/filer_public/.../mypicture.jpg/, which does not exist.

Could this be related to the internationalization settings in the url.py? It would be great if someone could help me. Many thanks in advance!!!

UX improvements - reduce the complexity of the plugin configuration for editors

It's great that we have collapsible elements already that hide most of the scary settings, I would like to propose to iterate over this idea by moving up the most user-friendly settings.

It's all organized rather good, perhaps the only thing we need to change is the order. As a user I would open the collapsed elements from top to bottom, and when I open the Core section my first thought might be "this is for developers, no point in looking at the sections below" :) . Perhaps we can rearrange them as following:

  • Toolbar on fullscreen
    • enable actual size button
    • enable zoom buttons
    • enable fullscreen button
  • Social networks sharing
  • Gallery Thumbnails
  • Everything else

Problem with importing ugettext_lazy

Django version is 4.2.11
DjangoCMS version is 4.1.0

File "/home/andrei/.pyenv/versions/3.8.18/envs/aero/lib/python3.8/site-packages/light_gallery/models.py", line 2, in <module>
    from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/home/andrei/.pyenv/versions/3.8.18/envs/aero/lib/python3.8/site-packages/django/utils/translation/__init__.py)

Compatibility with page optimization practices

Firstly thank you for an awesome library, I had an internal solution but will gladly switch to this package instead!

The first thing that I noticed is that scripts aren't deferred, which contradicts google page speed recommendations.

For example on all my projects I'm loading third party scripts though a deferred vendor.js file (since they aren't essential for page render), hence when this plugin scripts start working with dom my jquery is never loaded :)

I'll quickly post an MR 👍

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.