Forums

[resolved] [Plugin: NextGEN Gallery] Image TITLE UNDER IMAGE in THICKBOX / above CAPTION (2 posts)

  1. jparge
    Member
    Posted 2 years ago #

    After a good hour of searching and experimenting, all I can find is unanswered questions and dead ends. :(

    Surely it can't be that hard to have "$image->alttext" directly above the caption in bold writing in the thickbox?

    This is a very BASIC feature... I'm quite surprised that this plugin doesn't have it, it's got pretty much everything else! :P

    I know that there are several posts on these support boards asking this question, but none of them have been answered yet.

    So I think if you want this done too, and you are reading this, you should reply to bump the topic... that way we might eventually grab the attention of someone who knows!

    So far I have tried to modify the thickbox.js, but this causes problems in the other cases where thickbox is used.

    I'm not sure how this works, because I can't find any files in the gallery plugin that call to the shoutbox, nor any calls in the shoutbox to any gallery plugins. :(

    Any help is better than no help, if you have even the slightest idea I would really love to know about it! Much appreciated, thank you!

  2. jparge
    Member
    Posted 2 years ago #

    So it took a while but I figured it out.

    If anybody wants to have the same effect, you can do so by taking a look at the following file: root/wp-content/plugins/nextgen-gallery/view/gallery.php

    And what you are looking for is the following section:

    <!-- Thumbnails -->
    	<?php foreach ($images as $image) : ?>
    
    	<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $gallery->imagewidth ?> >
    		<div class="ngg-gallery-thumbnail" >
    			<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
    				<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
    			</a>
    		</div>
    	</div>
    	<?php if ( $gallery->columns > 0 &amp;&amp; ++$i % $gallery->columns == 0 ) { ?>
    	<br style="clear: both" />
    	<?php } ?>
     	<?php endforeach; ?>

    If you want the image title above the description text in the thickbox, you need to make the following alteration:

    <!-- Thumbnails -->
    	<?php foreach ($images as $image) : ?>
    
    	<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $gallery->imagewidth ?> >
    		<div class="ngg-gallery-thumbnail" >
    			<a href="<?php echo $image->imageURL ?>" title="<strong><?php echo $image->alttext ?></strong><br /><?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
    				<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
    			</a>
    		</div>
    	</div>
    	<?php if ( $gallery->columns > 0 &amp;&amp; ++$i % $gallery->columns == 0 ) { ?>
    	<br style="clear: both" />
    	<?php } ?>
     	<?php endforeach; ?>

    The code added was this:
    <strong><?php echo $image->alttext ?></strong><br />

    and it was added to this:
    <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>

    I hope that clears it up for anyone who was interested in this.

    You can change strong to whatever you want, I'm using <H6> which I've customized in the style sheet - works perfectly. All the best!

Topic Closed

This topic has been closed to new replies.

About this Topic