WordPress.org

Ready to get started?Download WordPress

Forums

Eazyest Gallery
[resolved] Thumbnails output: improve Thumbnail click set to -nothing- image option (14 posts)

  1. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    Don't wrap images into < a /> if the Thumbnail-click image option set to Nothing. This will break the links for search engines or browsers without javascript.

    Two more image options could be useful to get a clean output
    - no link on thumbnails. This will look nice with a medium/large thumbnail size.
    - no icontag wrap

    <ul class="small-block-grid-2"> <!-- gallery_div -->
    <li> <!-- <img src=thumbnail> --></li>
    <li> <!-- <img src=thumbnail> --></li>
    </ul>

    http://wordpress.org/extend/plugins/eazyest-gallery/

  2. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    Eazyest Gallery uses the WordPress gallery output which wraps images in link anchors.

  3. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    The plugin overwrites the output for the[gallery] shortcode.
    There is an extra option for captions. So you could have an extra option for image-anchor .

    Line 228 in class-eazyest-shortcodes.php:
    // Eazyest_Shortcodes::gallery_shortcode()
    
    foreach ( $attachments as $id => $attachment ) {
    
    if ( isset($attr['nolinkwrap']) && $attr['nolinkwrap'] ){ // just image
       $attr_image = array(
            'src'   => $attachment->guid,
            'class' => "",
            'alt'   => wptexturize($attachment->post_excerpt)
            );
       $link = wp_get_attachment_image( $attachment->ID, $size, false, $attr_image );
    
    } else { // as it was, output the link image
    
        $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
    
    }
  4. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    Actually, it doesn't
    The plugin only overwrites the gallery output when you have extra fields and you have selected to show descriptions in thumbnail view.
    However, this has not been implemented yet, so this part of the code is never called.

  5. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    There is no full control how to separate Eazyest Gallery output from gallery output for other pages.

    eg. How it's possible to change Blog galleries without affecting Eazyest Gallery pages?
    - In case the theme overwrites the [gallery] output, than will break the plugin options for future plugin versions.

  6. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    if you add a filter, you can always check if you are showing a gallery folder instead of a post.

  7. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    Interestingly Lazyest Gallery did have a different gallery view without affecting the normal [gallery] output and [gallery] shortcode theme settings.

    The logic is the same if the extra fields options are set, then the plugin overwrites the [gallery] shortcode ...
    In this case why there is a eazyest_gallery filter?

    Line 133 in class-eazyest-shortcodes.php:
    // Eazyest_Shortcodes::gallery_shortcode()
    
    // Allow plugins/themes to override the default gallery template.
    $output = apply_filters( 'eazyest_gallery', '', $attr );
      if ( $output != '' )
      return $output;

    >>> The plugin only overwrites the gallery output when you have extra fields and you have selected to show descriptions in thumbnail view.

  8. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    Yeah, but this is NOT Lazyest Gallery.
    Sorry, but I am not going to change this implementation of the thumbnails gallery.

  9. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    Ok.

    In this case we have to overwrite the [gallery] output,
    and copy the output code from the plugin function to support the extra fields option ... and hopefully this will not break future plugin options.

    Hope in the future the plugin will optionally support it's own markup for Eazyest Gallery pages.

    ps: For others who have the same problem:
    This is not resolved by the core plugin, need a workaround in theme functions.

  10. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    The good thing is that this will be supported by WordPress 3.6:
    http://core.trac.wordpress.org/ticket/18178

  11. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that would make live quite easier.
    I'll use it in 0.2.0

  12. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    After a second read: this patch is not set to 'commit' yet. Let's wait until it is really implemented.

  13. Marcel Brinkkemper
    Member
    Plugin Author

    Posted 1 year ago #

    Fixed in trunk by using preg_replace() on 'wp_get_attachment_link' filter

  14. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    The related ticket now is resolved and will be part of the next WordPress.
    Add "none" option to $attr['link'] for [gallery] shortcode:
    http://core.trac.wordpress.org/ticket/18178

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic