Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
wagtail-photo-gallery
Advanced tools
With this extention you are just a few steps away from a simple photo gallery for your wagtail page.
The gallery is configurable with the wagtail admin panel and is suited for large amounts of photos.
The key idea of this package is to store and manage photos independently of the usual wagtail images. Instead, all photos are assigned to albums and can be managed by a drag-and-drop sorting widget (which also supports item selection for mass-dragging and deletion).
To organize your photos, a Collection
is assigned to each album, by default the Root Collection
is used.
Embedding the photo gallery within a StreamField
is now done by adding a GalleryBlock
with reference to the desired Collection
.
pip install wagtail-photo-gallery[pillow]
# or
pip install wagtail-photo-gallery[pillow-simd]
If you need the fastest possible image uploading (Faster resizing) use pillow-simd
.
Add the following to your settings (base.py):
INSTALLED_APPS = [
#...
'wagtail_photo_gallery',
'wagtail.contrib.routable_page',
#...
]
Update your database structure using (remember to create a backup first):
./manage.py migrate
Once you've installed this addon and configured the settings as above,
all you need to do is to inherit from ImageGalleryMixin
and to add GalleryBlock
to your StreamField
.
# models.py
from wagtail.models import Page
from wagtail.fields import StreamField
from wagtail.admin.panels import FieldPanel
from wagtail_photo_gallery.blocks import GalleryBlock
from wagtail_photo_gallery.mixins import ImageGalleryMixin
class YourWagtailPage(ImageGalleryMixin, Page):
content = StreamField([
#...
("gallery", GalleryBlock()),
#...
], blank=True)
# content panel for the CMS (same as always)
content_panels = Page.content_panels + [
FieldPanel("content"),
]
If you want to use the pre-defined CSS-flexbox layout for the albums,
you need to include the following css code in your gallery page (YourWagtailPage
)
{% include 'wagtail_photo_gallery/extra_css.html' %}
{% extends "base.html" %}
{% load wagtailcore_tags %}
{% load static %}
{% block body_class %}template-homepage{% endblock %}
{% block content %}
{% for block in page.content %}
{% include_block block %}
{% endfor %}
{% endblock content %}
{% block extra_css %}
{% include 'wagtail_photo_gallery/extra_css.html' %}
{% endblock %}
FAQs
An image gallery plugin for Wagtail
We found that wagtail-photo-gallery demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.