Hello,
I'm using the Gallery module with the the Fancybox template and i'm having problems getting it to display images they way I want it to.
First of all I would like it to show 5 images per row, at the moment it just puts on as many as will fit. I would also like these rows to be centered on a per row basis.
I've tried a lot of things today to get this to work but i'm having zero luck.
Can anyone help?
Thanks
John
[SOLVED] Gallery module - 5 images per row
[SOLVED] Gallery module - 5 images per row
Last edited by jwaiv on Fri May 20, 2011 10:11 am, edited 1 time in total.
Re: Gallery module - images per row
Just add a width of the <div class="gallery"> to the stylesheet in which will fit 5 images.
To center that div, a margin: 0 auto; should do the trick
To center that div, a margin: 0 auto; should do the trick
Re: Gallery module - images per row
Thanks for that, I did not quite work as I thought it would. I found someone on the forum who was doing a 3*3 grid and altered it a little to match what I wanted it to do.
The above is what I used, puts 5 images on each row and centres each set of rows individually (so it does not look as odd when theres a final row with under 5 images).
Thanks
Code: Select all
<div class="gallery">
<div align="center">
<table>
<tr>
{foreach from=$images item=image name=foo}
<td>
{if $image->isdir}
<a href="{$image->file}" title="{$image->title}"><img src="{$image->thumb}" alt="{$image->title}" /></a><br />
{$image->title}
{else}
<a class="group" href="{$image->file}" title="{$image->title}" rel="gallery"><img src="{$image->thumb}" alt="{$image->title}" /></a>
{/if}
</td>
{if $smarty.foreach.foo.index % 5 == 4}
</table></tr></div><div align="center"><table><tr>
{/if}
{/foreach}
</tr>
</table>
</div>
Thanks