A gallery for FeinCMS
Project description
Introduction
This is a gallery app and contenttype for Feincms. It allows for several gallery ‘types’, each with its own tempate, css and javascript files. It comes packed with several pretty types ready for use:
The classic grid type, with caption, lightbox image and pagination.
Image carousel: a single line scrollable strip
Slideshow: A simple slideshow
Fancy panel: A fancyer slideshow with lots of different transitions
Product gallery: One large image with smaller thumbnails.
The CSS and Javascript files for the galleries are only loaded on demand using the form media class.
The admin frontend has thumbnail view for the gallery images and drag and drop functionality for image sorting.
Installation
At this time, there is no prebundled installation file to install via pip or easy_install. So get the source at: https://github.com/feinheit/feincms_gallery
Make sure to add the gallery to your Python path.
Add gallery to your INSTALLED_APPS in your settings.py
Add url(r'^gallery/', include('gallery.urls')), to your urls.py
In your application/models.py create the content type:
from gallery.models import GalleryContent Page.create_content_type(GalleryContent)
run python manage.py syncdb
add {{ feincms_page.content.media }} (or media.js and media.css) to the <head> of your template.
Usage
For each type, there is a gallery template, a JavaScript and CSS. They are in the folder templates/content/gallery, or static/content/gallery. For the types carousel, panel and product there is a link to the document page as a comment in the JS file.
To customize the gallery to your site, it’s best to copy the CSS and JS in your own media folder and edit it there. The configurations are stored in separate files.
To be able to adjust fancybox.init(), the gallery.js file from the gallery/media folder must be copied to the project media folder.
It is possible to define a template fallback, if a gallery contains only one image. E.g. product.html has the fallback template image_product.html.
You can use standard types or define your own gallery types like this:
from gallery import specs from gallery.models import GalleryContent GALLERY_TYPES = [ specs.ClassicLightbox(), # standard type specs.Type( verbose_name=_('Fancy paginated gallery'), paginated=True, paginate_by=12, orphans=4, template_name='fancy_gallery.html', media={'css' : {'all' : ('gallery/gallery.css', 'lib/fancybox/jquery.fancybox-1.3.1.css'),}, 'js' : ('gallery/gallery.js', 'lib/fancybox/jquery.fancybox-1.3.1.pack.js') } ) ] Page.create_content_type(GalleryContent, regions=('main',), types=GALLERY_TYPES)
When replacing an image file in the admin frontend, you have to save the page for the thumbnail to update itself.
Release History
1.2.3: Rename popup parameter to be consisten with newer Django versions.
1.2.2: The latest version compatible with Django 1.5
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file feincms-gallery-1.3.1.tar.gz
.
File metadata
- Download URL: feincms-gallery-1.3.1.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9248cbcc8096910bd9c7e8d18e24148cc5356c13e500d389fbdfa692d42cad06 |
|
MD5 | ad3ec02ea0ee9e1cdb9bb9a402ed1366 |
|
BLAKE2b-256 | c6aa0e9a4fdd0c604d16b83c001eeca929c5c8dfbf26b18b93dc50b898ce48b9 |
Provenance
File details
Details for the file feincms_gallery-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: feincms_gallery-1.3.1-py3-none-any.whl
- Upload date:
- Size: 40.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a96645a695bd2ee0448fc358887c56da0e74b2a22502c26a06487999dacd02a9 |
|
MD5 | 8357c0e989d3bbf7b185601c3e6925c0 |
|
BLAKE2b-256 | 04e3cfd11622bc5c3600a1ccd42f28b8b7dc8236dfd3a62a3cd1f10d9af2c06a |