• Resolved applenights

    (@applenights)


    I am using the Photonic plugin in my WordPress website in which I’m building with Divi. I placed a shortcode in a divi code module in my home page’s custom theme to display 6 of the most recent cover photos of photo albums uploaded to my smugmug.com account.

    When I click on a cover photos, Photonic passes a long stringed url to my photoalbum page where it’s not displaying the album photos. I tried several variations of shortcodes that don’t work. i.e.: [gallery type=“smugmug” nickname=“applenights” pop=“page”] —> doesn’t work.

    Can anyone provide tips in fine tuning either my settings or short code that will display on my photoalbum page the usual Smugmug photoalbum banner, the read more description button, the description, the photo album photos with the download arrow and buy buttons.

    Thanks in advance!

    The page I need help with: [log in to see the link]

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

    (@sayontan)

    When I click on a SmugMug album on the page you have provided, I see an error on the page that says, “⚠️ No album selected. Please provide an album_id in the URL.” This message is coming from your theme – nowhere in Photonic do I have any text that says this. This leads me to think that you have some sort of a conflicting setup either with your theme or with another gallery plugin.

    When I deconstruct the “long stringed url” for the first thumbnail, this is the Photonic shortcode that I see:

    [gallery columns="auto" layout="mosaic" display="local" popup="page" filter="" filter_type="include" more="" panel="" custom_classes="" alignment="" photo_layout="mosaic" caption="title-desc" thumb_size="Tiny" main_size="Largest" tile_size="same" video_size="1280" empty="false" view="album" nick_name="applenights" start="1" count="6" photo_count="500" media="all" album_sort_order="Date Added (Descending)" type="smugmug" style="default" overlay_size="Tiny" overlay_video_size="1280" album="jqZcSp"]

    This is a perfectly formed shortcode, and I see all the parameters that Photonic requires. Indeed, if you paste this shortcode out on a different page, you will see the gallery come out properly.

    Have you assigned the template page correctly? Can you ensure that the template page specified is only being used for Photonic and nothing else?

    Thread Starter applenights

    (@applenights)

    Hi Sayontan,

    I greatly appreciate your help and response. So after struggling for so many days in trying to find the right shortcode, I consulted Chatgpt for assistance. It provided me a php script to enter into my child function.php that parsed the url, and enabled it to provide listing I’m looking for… here’s the php script:

    ////// Trying out a Photonic url decoder to properly display albums on my photoalbum page

    // This corrects the url and passes the proper parameter values

    add_filter('photonic_albums_smugmug_album_link', function($link, $album, $display) {

    // SmugMug album ID (e.g. jqZcSp)

    $album_id = $album['AlbumKey'];

    // Album title (e.g. Green and White Affair)

    $title = isset($album['Title']) ? sanitize_title_with_dashes($album['Title']) : 'untitled';

    // Return custom internal link

    return home_url("/photoalbum/?album_id={$album_id}&title=" . urlencode($title));

    }, 10, 3);

    // Shortcode: [dynamic_photonic_album]

    add_shortcode('dynamic_photonic_album', function() {

    if ( isset($_GET['album_id']) ) { // ✅ CHANGED FROM photonic_gallery to album_id

    $album_id = sanitize_text_field($_GET['album_id']);

    $title = isset($_GET['title']) ? sanitize_text_field($_GET['title']) : '';

    ob_start();

    // Optional title above album

    if ($title) {

    echo '<h1 class="photonic-gallery-title">' . esc_html($title) . '</h1>';

    }

    // Use [gallery] shortcode format preferred by Divi Code Module

    echo do_shortcode('[gallery type="smugmug" view="album" album="' . esc_attr($album_id) . '" caption="title-desc" popup="page"]');

    return ob_get_clean();

    } else {

    return '<p>⚠️ No album selected. Please provide an album_id in the URL.</p>';

    }

    });

    This url that’s passed from the home > album cover photo is missing the album id:
    https://woocommerce-1440268-5386905.cloudwaysapps.com/photoalbum/?photonic_gallery=W2dhbGxlcnkgY29sdW1ucz0iYXV0byIgbGF5b3V0PSJtb3NhaWMiIGRpc3BsYXk9ImxvY2FsIiBwb3B1cD0icGFnZSIgZmlsdGVyPSIiIGZpbHRlcl90eXBlPSJpbmNsdWRlIiBtb3JlPSIiIHBhbmVsPSIiIGN1c3RvbV9jbGFzc2VzPSIiIGFsaWdubWVudD0iIiBwaG90b19sYXlvdXQ9Im1vc2FpYyIgY2FwdGlvbj0idGl0bGUtZGVzYyIgdGh1bWJfc2l6ZT0iVGlueSIgbWFpbl9zaXplPSJMYXJnZXN0IiB0aWxlX3NpemU9InNhbWUiIHZpZGVvX3NpemU9IjEyODAiIGVtcHR5PSJmYWxzZSIgdmlldz0iYWxidW0iIG5pY2tfbmFtZT0iYXBwbGVuaWdodHMiIHN0YXJ0PSIxIiBjb3VudD0iNiIgcGhvdG9fY291bnQ9IjUwMCIgbWVkaWE9ImFsbCIgYWxidW1fc29ydF9vcmRlcj0iRGF0ZSBBZGRlZCAoRGVzY2VuZGluZykiIHR5cGU9InNtdWdtdWciIHN0eWxlPSJkZWZhdWx0IiBvdmVybGF5X3NpemU9IlRpbnkiIG92ZXJsYXlfdmlkZW9fc2l6ZT0iMTI4MCIgYWxidW09Ilc0WmdXciJd&photonic_gallery_title=Maxappeal%E2%80%99s%20Birthday%20Celebration

    ChaptGPT later suggested I go into Photonic settings to enable the option for a clean url where it will generate an album id for php script to use in order to display the correct photo album. I can’t find this option to change which is why I went searching for help and I found this forum.

    I entered the shortcode you provided in the code module in my photoalbum page; yes it does work but the album id is hard coded to: album=”jqZcSp”. I’m unable to view the other album cover contents when I click on them from my Home page.

    Can you provide a shortcode that will decode the base64 url string to pull out and use the album id to show the correct albums from the url strings passed by the photo album cover clicks?

    Also can is it possible to make my photoalbum page look like this:
    https://photography.applenights.com/Concert-and-Club/Green-White-Affair-2025
    Displaying the banner image, the Read button to view the entire description written in its proper format?
    Display the buy, arrow down (download) and share buttons?

    Please let me know and once again thank you in advance.

    Best regards,

    Joe Mathieu

    Plugin Author Sayontan Sinha

    (@sayontan)

    I am a little lost with the approach here – why did you need to write the custom code? More than 99.9% of Photonic’s functionality needs no additional code, and the “Albums in a separate page” functionality is very much supported within Photonic.

    You said you use Divi – is that disabling the Photonic wizard? The wizard pretty much builds out the shortcode for you in a few clicks. You can launch the wizard from the WordPress Classic Editor, the block editor / Gutenberg, Elementor, Beaver Builder, or the Widgets page. See here: https://aquoid.com/plugins/photonic/gallery-creation/.

    Only if you have no access to the wizard will you need to get into hand-crafting a shortcode. If your theme is disabling the wizard or not showing it, an easy way for you to get it is to simply create a page or a post without your theme’s editor features.

    In any case, this is the shortcode that will get you your albums in a justified grid:

    [gallery type="smugmug" view="albums" nick_name="applenights" layout="random"]

    Since you are looking to show photos in a different page and limit the number of albums to 6 (but probably show the full set of photos for each album), you will need to add a few parameters:

    [gallery type="smugmug" view="albums" nick_name="applenights" layout="random" photo_count=500 popup="page"]

    Since you are using the popup="page" feature, you will need to use a dedicated page for this feature. To do this:

    1. Create a new blank page from your WP backend. Let’s say the title of the page is “Photo Album”, and the slug is photo-album.
    2. Now, in the Photonic options, go to Photonic → Settings → Generic Options → Photo Template → Dedicated page to use for gallery display. For that option, pick the page you just defined. You can customize other settings for that page too. Save your settings.

    When you refresh your gallery page and click on your album thumbnails now, you will automatically be taken to the custom page you have defined, and you should see the album’s photos there.

    You should delete or comment out all the custom code that you wrote for this – that is not necessary, and will conflict with the Photonic functionality.

    Thread Starter applenights

    (@applenights)

    Hey Sayontan,

    I am sorry this is confusing you.. I’ll explain my problem more clearer, this shortcode you provided:

    [gallery type="smugmug" view="albums" nick_name="applenights" layout="random" photo_count=500 popup="page"] 

    This displays every single album cover from my Smugmug account on my photoalbum page: https://woocommerce-1440268-5386905.cloudwaysapps.com/photoalbum/
    This page is suppose to show the contents of the photo albums, and not display the photo ablum covers. Btw, look at the photo count written on the bottom of each photo. When you click on the album cover, where do I view the photos? This is my problem 🙂

    Btw yes I didn’t know how to view the Photonic shortcode wizard builder before. But after followed your directions in creating a new page, I do see the shortcode wizard now. I used it, and I’m still stuck trying to figure out a solution the same problem.

    I did already configured a popup=”page” setting within Photonics settings in order to view the popup page on the photoalbum page.

    My main dilemma is how do I click on one of the 6 photo album covers from my home page:
    https://woocommerce-1440268-5386905.cloudwaysapps.com/

    Note: These are the 6 album covers I have displayed on my home page.

    How do I view the selected album cover’s content (photos from these album cover) on the photoalbum page:
    https://woocommerce-1440268-5386905.cloudwaysapps.com/photoalbum/

    If you click on any one of these album covers, how do I view their content on this page below?
    https://woocommerce-1440268-5386905.cloudwaysapps.com/photoalbum/

    Please let me know thanks.

    Best regards,

    Joe Mathieu

    Plugin Author Sayontan Sinha

    (@sayontan)

    I already configured a popup=”page” setting in the Photonics setting to view the popup page the photoalbum page.

    Can you please provide me with a screenshot to your settings page? You need to ensure the following:

    • The page you are specifying must not have any shortcode. I think right now you have a shortcode there. That should not be there.
    • This template page must not be used for anything else, like another plugin or theme. Can you also confirm that?
    • Make sure that you have deleted or commented out all the custom code.

    Basically, without any code whatsoever, your page should behave like “Example 3” here if your settings are done right. In my case, my photo template page has a slug, photonic-gallery, and that is what is used in the settings. It has some custom content, which is displayed at the top. Right below the horizontal line is where I have the description of the album present.

    Thread Starter applenights

    (@applenights)

    This is my destination page setting. . I deleted my Divi > custom theme builder’s > code module, and no photo displays when I navigate to this page. I need this page to be styled as the rest of the website, and provide viewers the ability to navigate elsewhere. Is there a way to keep my template, and display the album photos?

    Joe

    Plugin Author Sayontan Sinha

    (@sayontan)

    I need this page to be styled as the rest of the website, and provide viewers the ability to navigate elsewhere. Is there a way to keep my template, and display the album photos?

    If things were working correctly, the album display would follow the same styling as the rest of your site.

    At this point, I am unsure of what is going on – the issue is occurring likely due to your theme having its own page and template handling logic. I don’t know if you have access to a dev site with other themes (basically, themes distributed out of wordpress.org). If you do, then you might want to do a simple test of the same setup there with a simpler theme. I haven’t had to help Divi users with this previously, so unfortunately I cannot say if this is an incompatibility issue or something else. This is quite literally the first time anyone has had an unresolved issue this feature.

    Obviously, there are other ways to display your photos (via popup='show'), but my guess is that you have already tried it and are not a fan.

    Thread Starter applenights

    (@applenights)

    At this point I guess I’ll have to revert back to that old ChatGPT function.php script method. Instead of passing that long base64 url string, is there a way I can pass a parameter that includes the “album id” when I click on one of the album cover thumbnails from my home page?

    Is there a setting in Photonic I can change to enable this feature?

    Joe

    Plugin Author Sayontan Sinha

    (@sayontan)

    Rather than trying to pass the album id (which is going to require you to tinker with quite a bit of JS code that cannot be attached to a hook), simply decode the input string from the URL. If you do a base64_decode for the photonic_gallery parameter, you will get the full shortcode that you need. You can then run a do_shortcode on that to construct your gallery. There is a lot more than happens on a shortcode than simply passing the id.

    Thread Starter applenights

    (@applenights)

    Good morning Sayontan,

    I appreciate your tip in using the base64_decode in order to pull the album id. This help resolve my issue, please view my home page link:
    https://woocommerce-1440268-5386905.cloudwaysapps.com/
    When you click on any album cover, it passes the correct album id over to the photoalbum page and displays the correct photo album content.

    This is the code I entered in my child-theme’s function.php to parse out the album id:

    // This corrects the url and passes the proper parameter value for album="album id"

    add_shortcode('dynamic_photonic_album', function() {

    // Check if the base64 'photonic_gallery' parameter is present

    if (isset($_GET['photonic_gallery'])) {

    $encoded = $_GET['photonic_gallery'];

    $decoded = base64_decode($encoded);

    // Try to extract album="..." from the decoded string

    if (preg_match('/album="([^"]+)"/', $decoded, $matches)) {

    $album_id = sanitize_text_field($matches[1]);

    $title = isset($_GET['photonic_gallery_title']) ? sanitize_text_field($_GET['photonic_gallery_title']) : '';

    ob_start();

    if ($title) {

    echo '<h1 class="photonic-gallery-title">' . esc_html($title) . '</h1>';

    }

    // Construct the full Photonic shortcode dynamically

    $shortcode = sprintf(

    '[gallery columns="auto" layout="mosaic" display="local" popup="page" filter="" filter_type="include" more="" panel="" custom_classes="" alignment="" photo_layout="mosaic" caption="title-desc" thumb_size="Tiny" main_size="Largest" tile_size="same" video_size="1280" empty="false" view="album" nick_name="applenights" photo_count="500" media="all" album_sort_order="Date Added (Descending)" type="smugmug" style="default" overlay_size="Tiny" overlay_video_size="1280" album="%s"]',

    esc_attr($album_id)

    );

    echo do_shortcode($shortcode);

    return ob_get_clean();

    } else {

    return '<p>⚠️ Could not find album ID in gallery data.</p>';

    }

    } else {

    return '<p>⚠️ No gallery data provided in URL.</p>';

    }

    });

    I am very surprised no one had experience this issue in all these years. Hopefully you will consider using this idea to provide this feature as a new shortcode parameter.

    One more question, please take a look at the way the photo album’s description displays on top of the of the photos:

    Is there a shortcode parameter setting to enable the description to keep it’s proper format?
    Or a shortcode parameter to provide a read description button like this image from my smugmug gallery:

    …and display the description in a popup window like this:

    Please let me know if this is possible; thank you in advance!

    Best regards,

    Joseph Mathieu

    Plugin Author Sayontan Sinha

    (@sayontan)

    I am very surprised no one had experience this issue in all these years. Hopefully you will consider using this idea to provide this feature as a new shortcode parameter.

    A new feature is not needed, as the plugin automatically takes care of doing all of this for you. For some reason (most likely a conflict between Photonic and your theme), this is not working for you, but this is absolutely not needed as a new feature; the whole ability to do this all in one page without code is built into the plugin by default.

    To that end, you technically don’t need to do what you did in terms of code as well. This line from your code gives you the full shortcode:

    $decoded = base64_decode($encoded);

    You don’t need to do a preg_match etc. Simply replacing echo do_shortcode($shortcode); with echo do_shortcode($decoded); should suffice.

    As I have explained, internally the plugin does precisely that. That is the behaviour that you see in the demo link that I provided.

    Is there a shortcode parameter setting to enable the description to keep it’s proper format?
    Or a shortcode parameter to provide a read description button like this image from my smugmug gallery:

    This is the data that is returned by SmugMug’s API. For reference, see this: https://api.smugmug.com/api/v2/album/jqZcSp. All the formatting is stripped out by SmugMug when it returns the description as a part of the API call. Also, it is a little risky to rely on HTML from an external source, as it may be malformed or unsecure. That can cause serious issues on the receiving website.

    Thread Starter applenights

    (@applenights)

    Hey Sayontan,

    I fixed the album’s description format issue. Please take a look:
    https://woocommerce-1440268-5386905.cloudwaysapps.com/photoalbum/

    Thread Starter applenights

    (@applenights)

    Thread Starter applenights

    (@applenights)

    I am having some difficulty with the display order. According to Smugmug’s api call list i.e.:
    Url: https://api.smugmug.com/api/v2/folder/user/AppleNights/Concert-and-Club!albums

    Album [1 of 164] – Green and White Affair 2025
    /api/v2/album/jqZcSpAlbum [2 of 164] – Enos Birthday Celebration
    /api/v2/album/fGBq4zAlbum [3 of 164] – Maxappeal’s Birthday Celebration
    /api/v2/album/W4ZgWrAlbum [4 of 164] – “My Birthday, My Way” Kreyol La Yacht Party / Ti Joe’s Birthday Bash
    /api/v2/album/TgjJDpAlbum [5 of 164] – JE T’AIME MAMAN Feat. TATAN & SMOOTH JUDE
    /api/v2/album/Lzf5wDAlbum [6 of 164] – Klass 13th Anniversary Gala
    /api/v2/album/7gtPdHAlbum [7 of 164] – Joe Blizzy Album “Tha Plug” Album Release Party | After Work Mondays
    /api/v2/album/bq2wb8Album [8 of 164] – Thanksgiving’s Classic Night featuring Tropicana and Zafem
    /api/v2/album/xWMnH5Album [9 of 164] – SINFUL GOUYAD
    /api/v2/album/Ld4CTn

    As you can see, this list from Smugmug displays the albums within the Concert-and-Club folder exactly as it is listed in my Smugmug account. Here’s my smugmug account’s url for that folder:
    https://photography.applenights.com/Concert-and-Club

    This is the short code I entered on my web page to display the entire album within my Concert-and-Club folder:

    [gallery type='smugmug' view='albums' album_sort_order='Date Added (Descending)' filter='jqZcSp,fGBq4z,W4ZgWr,TgjJDp,Lzf5wD,7gtPdH,bq2wb8,xWMnH5,Ld4CTn,Kf8JZS,8GCRQx,S4wN8B,HFhHxr,8gXTcb,hMd7fQ,f7kpMT,ZrtZqv,cNKmsn,MG5v5L,9sVB8z,MTpJnL,PkmNfh,H9xBML,8bLsrP,fCSjjV,WMNbbR,gc7JkB,bcv7kF,zsbLd9,vfG7bW,3RXtzJ,WGGdqh,4nxL8,vSTbSG,2fp52n,PXJzDx,LHZ7cH,t3btTf,rtPhJj,L99K29,PGsHDT,gSwDDW,FsJKCj,cfL4VH,b9f4b5,ZrdMC7,R2xcjv,Pg83J4,jPGSrb,75W2Th,vtVdnk,MdvpKQ,hk9qsx,gVKX5B,nZcZTQ,d5TLjf,F54npN,g6fnVd,sWd8SR,GcchJm,fbzG7F,VKRvmD,Q3s2F8,JPSCHw,6kn3Fn,74zgZL,jss26x,xJmmXg,2PSP8k,xdGP7K,tLRv6m,BPdRkv,9dMzJj,KFCfPw,zFfKTv,89gLPL,hQZpgx,XQCcNZ,pFj5Xf,kGmZJr,4QzHtK,S7bV7B,SHw2Sq,qhzQFP,Wz3Dv3,CvcT4f,8PfQVC,trVbF3,8wccdk,nzvJ68,v7NtvG,bDMGQj,PqCtmC,MSt3WL,TtBH3c,2qgxxh,67gVrk,rZZXcb,2LSmbR,sHnTJT,JpxXvG,JS5jZM,BpkVn8,3XKKw8,BCJbKc,68c24R,XnqB5t,jrMSMT,Qrgc2D,xDRHf6,gwH796,hPrrwX,kZSf86,vczGZ3,mrLC8N,2PJhT7,HkjgbM,rrQL66,KL64BG,mvZWZF,FqfHXK,X3gwHc,NnXBSC,WtMkfm,fVmxHH,XprWq4,8vL58Z,RRgLzH,bdQMN4,hZRhP5,GVw98X,L6bHKX,VcnDFK,jKZSgL,jRScD7,ZGSdtB,NNzLJL,7rt2nq,6RvPh7,6826Bv,hkmbzn,NJ4sxL,HjwZvP,Fk5S86,JHkWJV,H65ZVB,G5jbzn,nMss3X,kKvM4z,mCsZBC,TF2wwc,mpRRJZ,rtkfqs,WG86F6,mdmdSK,FWXSm2,jNWtH5,gpVLt2,fK4QKF,q44k7R,fPC8C2,vBbWKz,q8Xc2b,v89NHw' nick_name='AppleNights' layout='masonry' display='local' columns='2' start='1']

    For some reason, even though I listed the album codes exactly the way they’re listed in the Smugmug api. Photonic does not display my albums the same way. Even though I use this parameter: album_sort_order=’Date Added (Descending)’ , it still displays the album in a different order. Please view this page:
    https://woocommerce-1440268-5386905.cloudwaysapps.com/clubevent-photos/

    As you can see the album titles do not match the list order from the smugmug api url: https://api.smugmug.com/api/v2/folder/user/AppleNights/Concert-and-Club!albums

    Is there a way I can enforce the sort order because this parameter setting “album_sort_order=’Date Added (Descending)'” doesn’t work.

    Please let me know thanks.

    Joe

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Unable to view photo album contents afrer after clicking album cover’ is closed to new replies.