• Hello,

    Working on a new site with Photonic and I’m trying to template things to make users’ work easier when they add new pages. I use Photonic’s Google Photos access quite often as it’s easier to store them there than on my own server. Is there a function I can call to get a list of all albums and their IDs as an array? I know about the helper but is there a way to just return the raw data? My idea is to dynamically load this into an Advanced Custom Fields dropdown (ACF allows for this) to let the user select which album they want to display on the page, then pass that ID into a shortcode which will be rendered in the custom page template. I can’t provide a link as this is a dev site, but any help would be much appreciated. I can try to explain more if necessary.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    I know about the helper but is there a way to just return the raw data?

    You mean the raw data from Google? You might be better off writing your own API wrapper for that. Since Photonic needs to standardize data from all platforms (Flickr, SmugMug, Google etc.) into a common format, the raw data is never stored or passed along anywhere. It is converted to a common format right after the call. Since the bulk of the coding is in PHP, the common format is generally a PHP object rather than JSON output.

    That being said, Photonic supports the concept of giving each album its own page automatically, but probably not the way you want it. You can look at the demo page, “Example 3 – Album on a Separate Page”.

    Thread Starter meisemann1999

    (@meisemann1999)

    Thanks for your reply – to be more specific, I’m looking for a way to return a list of Album IDs from the Google Photos API. I’ll look into writing the API wrapper but it’s not something I’m very familiar with.

    Plugin Author Sayontan Sinha

    (@sayontan)

    Just getting the album ids from Google’s API doesn’t serve any purpose for Photonic – the album id is a completely random string of characters that is unintelligible to a user. So, to be truly useful, Photonic needs to get the album name as well as the album thumbnail, and that is what the code does.

    I feel that if you write a wrapper, you will see that the album ids don’t make much sense there – a user will always need to find some other reference to see what that album id corresponds to.

    As an aside, for several years Photonic had no gallery builder wizard, and it relied on a “dumb” shortcode constructor, where you had to plug in an album id that you could fetch from the helper. This posed several usability challenges because users could not figure out which id corresponded to which album. This resulted in a slew of poor ratings. The wizard was finally delivered in 2018, and that transformed how galleries were built, largely changing the tone of the user feedback.

    Thread Starter meisemann1999

    (@meisemann1999)

    Thanks – if I write something of my own, my thought was to return both the album title and the ID. Advanced Custom Fields allows for a “Displayed” and “Actual” value so the album title would be displayed to the user while the ID would actually be stored when the post is updated. I’ll look into writing the API wrapper when I have some time. Hope this makes more sense.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Getting Array of Google Album IDs?’ is closed to new replies.