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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Imagegallery Pagination troubles


Go to End


6 Posts   1674 Views

Avatar
Cota

Community Member, 6 Posts

30 March 2010 at 6:05am

I'm pretty sure its just me....I have the image gallery up and running. It shows the correct number of images per page, however, no pagination shows. I'm doing a custom template for it, but dont know what to stick in there to get the pagination to show. Any help would be appreciated.

Cota

Avatar
UncleCheese

Forum Moderator, 4102 Posts

30 March 2010 at 6:42am

Can I see your template?

Avatar
Cota

Community Member, 6 Posts

30 March 2010 at 6:45am

<% base_tag %>
<% include header %> 
<!-- CONTENT -->
	<div id="container">
    	<div id="leftCont">
        	<div id="shadowBox">
            	<div id="boxImg"><img src="/themes/angela/images/placeHolder.jpg" width="315" height="278" border="0" /></div>
            </div>
            <div id="orangeBoxHome">
				<div id="homeText">$Content</div>
			</div>
        </div>
        <div id="rightCont">
        	<div id="pageTitle">$Title</div>
            <div id="pageContent">
				<div class="gallery-layout-wrapper">
					<% if GalleryItems %>
						<ul class="gallery-layout" id="gallery-list">
							<% if GalleryItems.NotFirstPage %>
								<% control PreviousGalleryItems %>
									<li style="display:none;">$GalleryItem</li>
								<% end_control %>
							<% end_if %>
					<% control GalleryItems %>
					<li>
						$GalleryItem
					</li>
					<% end_control %>
					<% if GalleryItems.NotLastPage %>
					<% control NextGalleryItems %>
					<li style="display:none;">$GalleryItem</li>
					<% end_control %>
					<% end_if %>
					</ul>
					<% end_if %>
				</div>
			</div>
        </div>
		<div class="clear"><!-- FILLER --></div>
    </div>
    <div class="clear"><!-- FILLER --></div>
<!-- END CONTENT -->

<% include footer %> 

Avatar
UncleCheese

Forum Moderator, 4102 Posts

30 March 2010 at 7:16am

Something like this?

		<% 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">$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 %>

Avatar
Cota

Community Member, 6 Posts

30 March 2010 at 7:24am

Edited: 30/03/2010 7:40am

Perfect. I knew it was just me. I went through the templates that came packaged with ImageGallery and couldnt seem to find that anywhere. I went through the forums and came up empty, finally just decided to ask.

ImageGallery is a bad ass little module. Saved me a weeks worth of work.

P.S.
Stupid me, thank you very much!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

30 March 2010 at 7:49am

Thanks.. Yeah, ImageGallery is a mixed blessing. If you're expecting it to do what it does, then it's a home run, but as soon as you want your gallery to behave differently, you quickly figure out that you're stuck in a box. I've tried to make it as customizable as possible, but it's still essentially a turnkey solution without a ton of flexibility unless you want to get your hands dirty doing some programming. It's nice that there's a lower entry point with ImageDOM, so users can build up, rather than hack down, their galleries.