itscoding / flickr-gallery
Use FlickrImages
Installs: 106
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 0
Open Issues: 2
Type:craft-plugin
Requires
- craftcms/cms: ^3.0.0
- zendframework/zend-filter: ^2.8
- zendframework/zend-hydrator: ^2.4
- zendframework/zend-servicemanager: ^3.3
Requires (Dev)
- phpunit/phpunit: ^7.3
README
Support on Beerpay
Hey dude! Help me out for a couple of 🍻!
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require itscoding/flickr-gallery
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for FlickrGallery.
Configuring FlickrGallery
Get a Flickr Api Key and store the "apikey" and "secret" in to your plguin options
Using FlickrGallery
The Plugins adds a Field you can use to craft
Field:
The Use the Field like every generic Craft Field, add your Flickr Album id, and choose if you want a PageError when the site has any Problem
https://www.flickr.com/photos/boscho87/albums/72157673777849508
=> 72157673777849508
{% set album = entry.flickr %} {% if not album.hasError %} <h2>{{ album.title }}</h2> <div class="galleries"> {% for image in album.images %} {% if not image.hasError %} <a href="{{ image.xxlargeUrl }}"> <img src="{{ image.smallUrl }}" alt="{{ image.title }}"/> </a> {% endif %} {% endfor %} </div> {% endif %}
Edge Cases / Nice to know
- The plugin internally uses Craft's cache to cache the requests, so its recommended to warm the cache after you changed images in the flickr gallery. After Saving a Page with Images, the Cache will be flushed!
- The plugin has no Pagination implementations for the Flickr Images, so its not Possible to load more than 500 images (Limit of one Request on Flickrs Site). If there are request about this, i maybe will implement this later
- Image Sizes , there are even more Sizes than just
{{ image.url }}
, but not every flickr Image can serve every size. Atm there is no error handling implemented. The "Flickr" Sizes- squareUrl
{{ image.squareUrl }}
- smallUrl
- thumbnailUrl
- mediumUrl
- largeUrl
- xlargeUrl
- xxlargeUrl
- squareUrl
The albums are loaded in the Crafts queue, if you want to enable loading from the Frontend, set the checkbox on the field!
Roadmap
- Write more tests
- Add Travis CI and Codacy Stuff (Coverage etc.)
- Implement a Cronjob/Task for Cache warming the Flickr stuff
- Do a request for every single image to check the available sizes etc. (This can not be done "on request" and needs a Cronjob)
- Implement a proper error handling when the Flickr Api is offline
Contributions / Issues
If you have feature Request or you want something done of the Roadmap, create an Issue. OR IF YOU FOUND A BUG IN THE CODE (even that could happen)
Brought to you by Simon Müller