Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @ethanalvin – An example of what you are trying to do might help … can you share a link to where you are displaying the album? Also, if you are using a custom template, you may need to review it’s code to ensure it is displaying things as you are expecting them to be seen.

    Thanks!

    – Cais.

    Thread Starter ethanalvin

    (@ethanalvin)

    Hi Cais,

    I managed to get the formatting right, but I’m trying to display the gallery description even though I’m using a compact album.

    I’ve added a new template (album-lightbox) to get the album to open in a lightbox.

    Kindly advise how I can add the gallery description to under the album title.

    Plugin Contributor photocrati

    (@photocrati)

    @ethanalvin – Add that detail to your custom template would be the most obvious idea I an think of … have you tried that?

    – Cais.

    Thread Starter ethanalvin

    (@ethanalvin)

    <?php
    /**
    Template Page for the album overview
    
    Follow variables are useable :
    
        $album     	 : Contain information about the first album
        $albums    	 : Contain information about all albums
    	$galleries   : Contain all galleries inside this album
    	$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 ($galleries)) : ?>
    
    <div class="ngg-albumoverview">
    
    	<!-- List of galleries -->
    	<?php foreach ($galleries as $gallery) : ?>
    
    	<div class="ngg-album-compact">
    		<div class="ngg-album-compactbox">
    			<div class="ngg-album-link">
    				<a class="Link" href="<?php echo nextgen_esc_url($gallery->pagelink) ?>">
    					<img class="Thumb" alt="<?php echo esc_attr($gallery->title) ?>" src="<?php echo nextgen_esc_url($gallery->previewurl) ?>"/>
    				</a>
    			</div>
    		</div>
            <?php if (!empty($image_gen_params)) {
                $max_width = 'style="max-width: ' . ($image_gen_params['width'] + 20) . 'px"';
            } else {
                $max_width = '';
            } ?>
            <h4>
                <a class="ngg-album-desc"
                   title="<?php echo esc_attr($gallery->title) ?>"
                   href="<?php echo nextgen_esc_url($gallery->pagelink) ?>"
                   <?php echo $max_width; ?>>
                    <?php echo $gallery->title ?>
                </a>
            </h4>
    		<?php if (@$gallery->counter > 0) : ?>
    		<p class="ngg-album-gallery-image-counter"><strong><?php echo $gallery->counter ?></strong>&nbsp;<?php _e('Photos', 'nggallery') ?></p>
    		<?php endif; ?>
    	</div>
    
     	<?php endforeach; ?>
    
    	<!-- Pagination -->
        <br class="ngg-clear"/>
     	<?php echo $pagination ?>
    </div>
    
    <?php endif; ?>

    Here’s the code. Any help would be appreciated!

    Plugin Contributor photocrati

    (@photocrati)

    @ethanalvin – You will need to add (at a minimum) the following into the template:
    <?php echo $gallery->galdesc; ?>
    Depending on where you add the above code will also dictate what additional styles you may need to address as well.

    I would suggest after the <h4><a> element, but anywhere within the foreach loop should be fine.

    – Cais.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Formatting Issue with Compact Album’ is closed to new replies.