sammond7
Member
Posted 10 months ago #
Hi All,
Has anyone got a good method for creating a list of images in a gallery but link using the Alt & Title Text instead of thumbnails?
Essentially, i'm after the same result as [nggallery id=x], but with text links in place of thumbnails.
Cheers!
sammond7
Member
Posted 10 months ago #
OK so I worked it out :)
Using templates is the answer to everything! Info on templates can be found here.
The template I made in the end is here:
<?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="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>">
<!-- Thumbnails -->
<?php foreach ( $images as $image ) : ?>
<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
<div><?php echo $image->description ?></div>
</a>
<?php if ( $image->hidden ) continue; ?>
<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
<br style="clear: both" />
<?php } ?>
<?php endforeach; ?>
<!-- Pagination -->
<?php echo $pagination ?>
</div>
<?php endif; ?>
That's the whole file so you can copy it in and see what it does! Hope this helps some others out there.