WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery Optimizer
[resolved] nextgen caption template and fancybox (6 posts)

  1. shadow84
    Member
    Posted 1 year ago #

    Thanks Mark for a fantastic plugin, I'm building an artist's website and using Nextgen extensively! it's done a brilliant job at speeding up load times. I'm using the premimium version of nextgen optimiser :)

    I have a (hopefully) quick question. I'm using Nextgen's [ nggallery=X template=caption ] option, and have managed to get a short synopsis of each image underneath the gallery thumbnails in image browser view (see http://www.rolfeknudsen.com.au/gallery/drawings/artwork/page-13/ for an example; but disregard the space beneath the captions, still tweaking!).

    From what I understand, I could get the gallery-caption.php template file to echo the alttext instead of the full description, which is what I want. I'd rather just have titles underneath the thumbnails (am pretty sure I know how to do this), as the length of image synopses may change, and I want the visual grid to look consistent.

    HOWEVER, i'm using fancybox, and when people click on the thumbnail image, I want the full-length nextgen description to appear, rather than the alttext. I've set the fancybox option to 'titlePosition: inside' to allow a short synopsis (contained in the nextgen description field) to wrap inside the white border around the image.

    Is there a way to allow nextgen thumbnail galleries to display the alttext in the caption template, while setting fancybox to display the longer nextgen descriptions?

    thanks in advance for your help, much appreciated! :)

    http://wordpress.org/extend/plugins/nextgen-gallery-optimizer/

  2. Mark Jeldi
    Member
    Plugin Author

    Posted 1 year ago #

    Hi shadow84,

    Thanks for using NextGEN Gallery Optimizer Premium...and also for your kind words!

    In order to use NextGEN's Alt/Title field for image captions (instead of the description field), you'll need to make a minor edit to the caption template at wp-content/plugins/nextgen-gallery/view/gallery-caption.php.

    Look for the following code (line 47)...
    <span><?php echo $image->caption ?></span>

    And replace it with...
    <span><?php echo $image->alttext ?></span>

    In regards to Fancybox, it uses NextGEN's Description field for its titles by default, so you shouldn't need to change anything there. The mod above will only affect your thumbnail captions.

    Hope this helps!

    Cheers,
    Mark.

  3. shadow84
    Member
    Posted 1 year ago #

    Wonderful, thanks so much for your help, worked like a charm :) really appreciate the fast response, too! :)
    Cheers again for an awesome plugin.

  4. Mark Jeldi
    Member
    Plugin Author

    Posted 1 year ago #

    Hi shadow84,

    No worries. I'm glad I could help.

    Just remember to back-up your newly customized gallery-caption.php before auto-updating to a new version of NextGEN.

    Cheers,
    Mark.

  5. @Raj
    Member
    Posted 1 year ago #

    Hi Mark Jeldi,
    I'd love to get an answer
    i m in trouble as i want to show thumbnail with few lines of post content on my blogs home page and full image with complete post content on the detailed page. Now everything is fine on detailed(single post) page but on home page i m not able to manage thumbnail with few lines of post using<?php the_content();?> as both the image and content is in the post and not in featured image so it is really difficult for me to show image and few line of posts under it
    this detailed page is ok
    but this home page still troubles me plzzzz save me with your kind attention........

  6. Mark Jeldi
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Raj,

    It sounds like you're overcomplicating things here. Is there a reason you can't use the featured image/post thumbnail functionality built-into WordPress? That's definitely the way I'd go, as it's a much more elegant solution for managing images in multiple sizes...

    http://codex.wordpress.org/Post_Thumbnails

    The only way I can think of doing that with NextGEN Gallery, is to manually fetch the corresponding thumbnail url and enter it into a custom field for each post on the Edit page. You could then echo out the custom field metadata in your homepage template, but it would require a lot more work per post than is necessary.

    Hope this helps!

    Cheers,
    Mark.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic