• Resolved Ilene Johnson

    (@ilenejohnson)


    I’m using the smug mug gallery with swipe box. Some of my images have captions, some do not. If they do not have a caption, the title in the hover and in the slideshow is “View”. I want the proper title if the image has one, but I don’t want “View” to show if it doesn’t. How do I accomplish this?

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

    (@sayontan)

    You will have to change code for this. The file to edit is photonic/extensions/Photonic_Processor.php. Look for this line:

    $title = empty($title) ? (empty($alt) ? __('View', 'photonic') : $alt) : $title;

    Replace 'View' with ''.

    Thread Starter Ilene Johnson

    (@ilenejohnson)

    And what happens when there is an upgrade? My change will be overwritten

    • This reply was modified 8 years, 5 months ago by Ilene Johnson.
    Plugin Author Sayontan Sinha

    (@sayontan)

    Yes, as is the case with any edit directly made to a file within a theme or a plugin, your change will be overwritten when you upgrade the plugin.

    If you are looking for a solution to avoid this, you will need a child theme and some JavaScript to capture and replace this text.

    Thread Starter Ilene Johnson

    (@ilenejohnson)

    I have my own theme, I have tried to capture and change the items in the gallery, but they are already set before hand. Any ideas how to do this? I have tried replacing the titles before hand on a single album, which works, but the solution doesn’t work when I enter the gallery from an album.

    Actually, if I enter the gallery thru an album, the data is transmitted through AJAX.

    • This reply was modified 8 years, 5 months ago by Ilene Johnson.
    Plugin Author Sayontan Sinha

    (@sayontan)

    Do you have a link to your site that I can look at?

    Thread Starter Ilene Johnson

    (@ilenejohnson)

    https://dev.camanabay.com/photonic-test/

    Going to the slideshow from this link, I cannot change the title “View”

    https://dev.camanabay.com/photonic-albums/

    Thread Starter Ilene Johnson

    (@ilenejohnson)

    Hold on, I have to open the site up for you

    Thread Starter Ilene Johnson

    (@ilenejohnson)

    Ok, try it now

    Plugin Author Sayontan Sinha

    (@sayontan)

    This seems like too much work for very little benefit. Here is a simpler solution – change the code I provided above to this:

    $title = empty($title) ? (empty($alt) ? apply_filters('photonic_default_lightbox_text', __('View', 'photonic')) : $alt) : $title;

    You can then do a call to add_filter in your theme / child theme’s functions.php, and add a filter for photonic_default_lightbox_text to blank the output.

    I will modify my code to include the filter hook above, so your updates will be upgrade-safe.

    Thread Starter Ilene Johnson

    (@ilenejohnson)

    But I still have the issue of it getting overwritten when an upgrade is done. yes?

    Plugin Author Sayontan Sinha

    (@sayontan)

    No. As I mentioned in my previous post:

    I will modify my code to include the filter hook above, so your updates will be upgrade-safe.

    This is pretty similar to how you code child themes:

    1. The parent theme / plugin provides you with action / filter hooks
    2. In your child theme you write your custom function to tie into this hook. This keeps your changes in place even if you upgrade the parent theme / plugin
    Thread Starter Ilene Johnson

    (@ilenejohnson)

    THat will work! Thank you

    Plugin Author Sayontan Sinha

    (@sayontan)

    Good to know. I am marking this thread resolved, unless you think something isn’t working.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Smug mug with Swipe box – captions’ is closed to new replies.