



(1 ratings)
| Number of watchers on Github | 43 |
| Number of open issues | 0 |
| Average time to close an issue | about 12 hours |
| Main language | PHP |
| Open pull requests | 0+ |
| Closed pull requests | 0+ |
| Last commit | about 2 years ago |
| Repo Created | over 3 years ago |
| Repo Last Updated | over 1 year ago |
| Size | 2.31 MB |
| Organization / Author | sitemarina |
| Contributors | 1 |
| Page Updated | 2018-03-12 |
| Do you use guggenheim? Leave a review! | |
| View guggenheim activity | |
| View on github | |
| Fresh, new opensource launches 🚀🚀🚀 | |
|
Trendy new open source projects in your inbox!
View examples
|
|
An algorithm for a perfectly balanced Gallery for Kirby CMS
See it live:
https://sitemarina.github.io/guggenheim/
Screenshot:
Guggenheim is a plugin for Kirby CMS which generates beautiful galleries through an algorithm for a perfectly balanced layout, which you might know from the awesome image grids at medium.com
Read more into the math and science behind the algorithm here: The algorithm for a perfectly balanced photo gallery
In my search for the perfect gallery, which could do this linear partition against the images, I really wasen't getting excited about all the countless client-side javascript solutions to the problem. As I care deeply about mobile, i simply didn't wanted to make the devices responsible for this task and wanted a PHP solution for the linear partition.
Buy a Single Domain License here https://sitemarina.github.io/guggenheim/ - *I am currently struggling pretty bad *
Pre-launch Option
Grab yourself a copy of Kirby - an awesome performant CMS
As Guggenheim now ships with PhotoSwipe, theres two ways to get up and running with Guggenheim and PhotoSwipe.
If youre using the Kirby Cachebuster Plugin or your sever policy doesnt allow loading assets from the plugin folder, you might want to fallback using the next and more preferred setup method and link up the sources in your own main assets/ folder.
The easy out of the box way: If youre in a hurry, prototyping or just quickly want to test out Guggenheim with PhotoSwipe, the easiest way is to just put this in your head
<?= css('assets/plugins/guggenheim/css/guggenheim-photoswipe.min.css') ?>
and this in your footer
<?= photoswipe() ?>
<?= js('assets/plugins/guggenheim/js/guggenheim-photoswipe.min.js', true) ?>
off you go, youre now all setup to use Guggenheim with PhotoSwipe.
The best way: To preserve your total hackable and artistic freedom, the preferred and best way is still that you manually implement the stuff from guggenheim/src into your specific design or fronted framework in your assets/ folder. And maybe only outputs the PhotoSwipe DOM in your footer, like so
<?= photoswipe() ?>
Dependency order
photoswipe.cssdefault-skin.css (and its image dependencies)photoswipe.min.jsphotoswipe-ui-default.min.jsGuggenheim
guggenheim.cssguggenheim-photoswipe.min.js (you can leave PhotoSwipe and this binding out entirely, if you just want to use Guggenheim on its own)in your site/config/config.php
// Add aditional classes to the guggenheim gallery element
c::set('guggenheim.classes', 'gallery zoom margin-center');
// Guggenheim is meant to be used with PhotoSwipe
// But if you for some reason don't want to use it, you can remove it additionals with
c::set('guggenheim.photoswipe', false);
// Guggenheim uses some basic srcset and sizes for basic responsiveness and highres support
// if you want to disable it, and make your own
c::set('guggenheim.srcset', false);
// Guggenheim adds a kirbytext tag, the default is 'gallery', but you can change it with
c::set('guggenheim.kirbytext.tagname', 'guggenheim');
Super simplistic -Generate a Guggenheim gallery with all the page images
(gallery:) or (gallery: all)
More generally, you want to pick out the pictures to make the gallery from, you do it like this
Comma separated:
(gallery: image-1.jpg, image-2.jpg, image-3.jpg)
Pipe separated:
(gallery: image-1.jpg | image-2.jpg | image-3.jpg)
..heck even both:
(gallery: image-1.jpg | image-2.jpg, image-3.jpg)
Options
Guggenheim lets you set some options for each gallery.
max-width: 100% - but do note that the images will still be resized according to the width option, so here you have the power to really screw things up for bigger screensizes if you aren't aware and doesn't overwrites the default srcset and sizes guggenheim ships with(gallery: image-1.jpg, image-2.jpg, image-3.jpg width: 800 height: 350 border: 10 class: mycustomclass)
Use the Guggenheim gallery in your templates
$images = $page->images()->sortBy('sort', 'asc');
echo guggenheim($images, array('width' => 800, 'height' => 350, 'border' => 10));
<?= photoswipe() ?>