Add an image gallery to your Kotti site
Project description
This is an extension to the Kotti CMS that allows you to add galleries with images to your Kotti site.
It uses Bootstrap Carousel for the gallery view.
Compatibility
As of Kotti 0.7 the image type from kotti_image_gallery has been moved to the Kotti core. Please use the kotti_gallery package, which supersedes this package with Kotti versions >= 0.7.
Setup
To activate the kotti_image_gallery add-on in your Kotti site, you need to add an entry to the kotti.configurators setting in your Paste Deploy config. If you don’t have a kotti.configurators option, add one. The line in your [app:main] section could then look like this:
kotti.configurators = kotti_image_gallery.kotti_configure
With this, you’ll be able to add gallery and image items in your site.
Image URLs
kotti_image_gallery provides on-the-fly image scaling by utilizing plone.scale (thanks to Tom Lazar for the hint).
Images (including arbitrary scales) can be referenced by this URL schema: /path/to/image_content_object/image[[/<image_scale>]/download] where <image_scale> can be:
a predefined image scale (see below)
a string of the form <max_width>x<max_height> or
a URL path segment of the form <max_width>/<max_height>
If the last URL path segment is download, the image will be served with Content-disposition: attachment otherwise it will be served with Content-disposition: inline.
Predefined image scale sizes
You may define image scale sizes in your .ini file by setting values for kotti_image_gallery.scale_<scale_name> to values of the form <max_width>x<max_height> (e.g. kotti_image_gallery.scale_thumb = 160x120 with the resulting scale name thumb).
thumb (160x120) and carousel (560x420) are always defined (because they are used in the default templates), but their values can be overwritten by setting kotti_image_gallery.scale_thumb and/or kotti_image_gallery.scale_carousel to different values in your .ini file.
Work in progress
kotti_image_gallery is considered alpha software, not suitable for use in production environments. The current state of the project is in no way feature complete nor API stable. If you really want to use it in your project(s), make sure to pin the exact version in your requirements. Not doing so will likely break your project when future releases become available.
Development
Contributions to kotti_image_gallery are highly welcome. Just clone its Github repository and submit your contributions as pull requests.
Note that all development is done on the develop branch and master is reserved for “production-ready state”. Therefore make sure to always base your work on the current state of the develop branch.
This follows the highly recommended A successful Git branching model pattern, which is implemented by the excellent gitflow git extension.
Testing
kotti_image_gallery has 100% test coverage. Please make sure that you add tests for new features and that all tests pass before submitting pull requests. Running the test suite is as easy as running py.test from the source directory.
TODO
cleanup HTML/CSS
add support for remote galleries (e.g. flickr photosets)
add tests
CHANGES
0.3.1
fix packaging (thanks to Marco Scheidhuber for reporting)
0.3
don’t duplicate code/functionality that already exists in Kotti
100% test coverage
0.2
Image inherits from File now.
Replaced repoze.bitblt based image scaling with much more powerful plone.scale based version.
0.1
Initial release.
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
Hashes for kotti_image_gallery-0.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4862cbbadb6ab3c3cdc68fc753d83c52848a0d54de10a436957501d770a7259a |
|
MD5 | 52a52fd39c000d33f2ca00643768618c |
|
BLAKE2b-256 | cf4bebf22869948f635bb0badd98b5426265f1eb119d08aff3b84dce23573a68 |