Displaying All Collections (🔗)
Flickr collections in Photonic can be viewed by the following short-code usage:
[gallery type='flickr' user_id='abc' view='collections']
The above displays all collections for the user. It does the following:
- Displays any combination of the collection thumbnail, title and number of Photosets at the top. Each is configurable through the options.
- Displays thumbnails of each of the Photosets in the collection, with options to turn off the title and photo-count display.
- Each Photoset’s thumbnail can be clicked to launch a slideshow for that Photoset.
The following is an example of all of my collections:
Displaying a Single Collection (🔗)
With a simple tweak of the short-code invocation you can make this display a single collection. I am displaying a collection from Dave Conroy:
[gallery type='flickr' user_id='abc' collection_id='xyz']
You can see the usage here, where I have displayed one of the collections from the above:
Lazy Loading of Collections (🔗)
The first shortcode is good, but it has a downside due to Flickr’s implementation of the Collections API. The way it works, you cannot get the nested photoset thumbnails in a single call and you need to make calls for each nested photoset. So, while it works fine for my collections, which have very few photosets, for Dave’s collections it is going to spin its wheels quite hard; after all Dave has 47 nested photosets at the time of writing this! This means your server will make 47 additional calls to Flickr before it can return anything to the browser! To tackle this issue Photonic supports lazy loading of collections, wherein you can pass the parameter
collections_display='lazy' in your shortcode. With lazy loading, just the collection name (and other header attributes) will be displayed, with a “+” for you to click and expand the list of available collections.
In the above, I am fetching 2 out of Dave’s collections in lazy loading mode, and only displaying the title and counter for them, using this shortcode:
[gallery type='flickr' user_id='40600878@N08' view='collections' filter='72157627778919301,72157626225643420' collections_display='lazy' headers='title,counter']
Displaying a Filtered List of Collections (🔗)
In the last example above, you can see the use of the
filter attribute to show a comma-separated list of collections instead of all the collections. This is another level of control that you have over the display of your collections.
If you wish to exclude a set of collections rather than include, you can do so by passing the