[Plugin: NextGEN Gallery] Custom NGG template: Display a gallery’s description IN the gallery page?
-
I’m making custom NGG templates for my NGG gallery. I don’t know PHP very well, so I’m using the tags from Alex’s default templates, and changing it to use my own layout / css.
I would like to have the ‘description’ from each gallery shown at the top of the gallery’s page. The the layout of each gallery page will basically be:
Gallery Title
Gallery Description
(Thumbnails)I tried putting <?php echo $gallery->galdesc ?> into the gallery.php template, but it doesn’t seem to display anything. Putting this same tag into the album.php template DOES display each individual gallery’s description, so it seems that this tag works, but I need to change something to use it in the gallery.php template? And yes, I do actually have a description entered into the NGG admin for the specific gallery I’m testing. ??
Here is the complete code for my gallery.php template. Note that I have inserted <?php echo $gallery->galdesc ?> into the div “gallery-description”.
<?php $album = nggdb::find_album( get_query_var('album') ); ?> <!-- this is needed to make the breadcrumb album and gallery names show up --> <?php /** Template Page for the gallery overview Follow variables are useable : $gallery : Contain all about the gallery $images : Contain all images, path, title $pagination : Contain the pagination content You can check the content when you insert the tag <?php var_dump($variable) ?> If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?> **/ ?> <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?> <div class="galleryoverview" id="<?php echo $gallery->anchor ?>"> <div id="gallery-heading"> <h3><?php echo $gallery->title?></h3> <div class="linkout"><a href="#">Return to the Image Gallery</a></div> </div> <div id="gallery-description"> <?php echo $gallery->galdesc ?> </div> <!-- Thumbnails --> <?php foreach ( $images as $image ) : ?> <div class="gallery-image" <?php echo $image->style ?> > <a>imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> > <?php if ( !$image->hidden ) { ?> <img class="gallery-thumb" title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> /> <?php } ?> </a> </div> <?php if ( $image->hidden ) continue; ?> <?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?> <?php } ?> <?php endforeach; ?> <!-- Pagination --> <?php echo $pagination ?> </div> <?php endif; ?>
Thanks!
- The topic ‘[Plugin: NextGEN Gallery] Custom NGG template: Display a gallery’s description IN the gallery page?’ is closed to new replies.