Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

ImageGallery show prev/next when no imgs


Reply


601 Views

Avatar
ivo

Community Member, 19 Posts

19 June 2010 at 11:43pm

hi
i did a fresh install for the imageGallery on Silverstripe 1.4 from svn and everything went smooth.
i renamed the default album and published, so thew page would be there and the the moderators could upload their images.

the template then rendered the previous and next buttons, although the album was empty.
after uploading one image the buttons were gone.

well thats noting that would make the earth shake, but still strange.

i slightly changed the template (see below)
but i dont think i deleted something important

ImageGalleryPage_album.ss

<div id="primaryContent">
<div class="innerpad">
      <h2>$AlbumTitle</h2>
      $GalleryLayout
      
      <% if GalleryItems.MoreThanOnePage %>
         <ul id="pagination-imagegallery">      
            <% if GalleryItems.NotFirstPage %>
               <li class="previous"><a title="<% _t('VIEWPREVIOUSPAGE','View the previous page') %>" href="$GalleryItems.PrevLink">&laquo;<% _t('PREVIOUS','Previous') %></a></li>            
            <% else %>   
               <li class="previous-off">&laquo;<% _t('PREVIOUS','Previous') %></li>
            <% end_if %>
            <% control GalleryItems.Pages %>
               <% if CurrentBool %>
                  <li class="active">assadsa $PageNum</li>
               <% else %>
                  <li><a href="$Link" title="<% sprintf(_t('VIEWPAGENUMBER','View page number %s'),$PageNum) %>">$PageNum</a></li>            
               <% end_if %>
            <% end_control %>
            <% if GalleryItems.NotLastPage %>
               <li class="next"><a title="<% _t('VIEWNEXTPAGE', 'View the next page') %>" href="$GalleryItems.NextLink"><% _t('NEXT','Next') %> &raquo;</a></li>
            <% else %>
               <li class="next-off"><% _t('NEXT','Next') %> &raquo;</li>            
            <% end_if %>
         </ul>       
      <% end_if %>
   <% if Albums %>
      </div>
   <% end_if %>
</div>