Page 1 of 1

SuperSizer in Fancybox template (Gallery)

Posted: Wed Apr 28, 2010 12:10 pm
by Elise
On my page (built with cmsms 1.6.6) I'm using Gallery 1.2.1 with the Fancybox template. I like it very much!
The only thing is I think the thumbnails used from the Image Manager are very small. When I set the size of the thumbnails they all get the same ratio and I want my thumbnails to have the same ratio as my images (3:4 or 4:3).
So I installed the supersizer tag.
I found this in the fancybox template:

Code: Select all

{foreach from=$images item=image}
	<div class="img">
	{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}
	</div>
{/foreach}
and replaced it with

Code: Select all

{foreach from=$images item=image}
	<div class="img">
	{if $image->isdir}
		<a href="{$image->file}" title="{$image->title}"><img src="{supersizer path=$image->file percentage='20'}" alt="{$image->title}" /></a><br />
		{$image->title}
	{else}
   <a class="group" href="{$image->file}" title="{$image->title}" rel="gallery"><img src="{supersizer path=$image->file percentage='20'}" alt="{$image->title}" /></a>
	{/if}
	</div>
{/foreach}
But it does not work!
Does anyone know why??

Re: SuperSizer in Fancybox template (Gallery)

Posted: Wed Apr 28, 2010 12:29 pm
by Jos
You do not need Supersizer to create thumbs in Gallery.

Just go to edit the Gallery template (Fancybox) and change the thumbnail size setting resize method to "scale" in stead of "crop"

With "scale" the settings width and height are max values for the thumb

With "crop" the settings width and height are the exact values for the thumb, cutting of the part that is out of that box.

In both ways the image proportions are retained.

Re: SuperSizer in Fancybox template (Gallery)

Posted: Wed Apr 28, 2010 12:40 pm
by Elise
Yes, thank you.
It's acceptable, but not quite what I want.
I want the thumbnail to show the whole image, and I want them all in the same scale. I just want miniature-images. Tha same scale, the same ratio and not cropped, so they will have different heights and widths.
What you described is what I have now, and it is nice, but is the solution with supersizer not possible?

I'm sorry, I didn't explain it properly in the first post.

Re: SuperSizer in Fancybox template (Gallery)

Posted: Wed Apr 28, 2010 1:00 pm
by Jos
I'm sorry I didn't notice the percentage parameter in the SuperSizer call. Don't know if all the parameters for SuperSizer are set right, but there might be an issue with the $image->file variable when spaces or other 'strange' characters (that are not allowed in a url) are used.

Re: SuperSizer in Fancybox template (Gallery)

Posted: Wed Apr 28, 2010 1:42 pm
by JeremyBASS
No you can use supersizer and Gallery ... it's just that the input needs to be normal... All you needs to do is add the php fuction to correct Gallery's out put..





file}" title="{$image->title}" rel="gallery">file|rawurldecode percentage='20'}" alt="{$image->title}" />


that should be it... this is still to do with http://forum.cmsmadesimple.org/index.ph ... #msg202450 on every usage of Gallery I had to fix this in the tag... Hope this helps.. Cheers -Jeremy

oh side not.. unless you are uing the test file (which is stable) make sure to watch the cases of the params.. http://forum.cmsmadesimple.org/index.ph ... 06308&nbsp; The test file was just right above that.. ;)

Re: SuperSizer in Fancybox template (Gallery)

Posted: Wed Apr 28, 2010 2:18 pm
by Elise
Thank you very much for your help.
I'm using the test file now and changed the template to

Code: Select all

<div class="gallery">
{foreach from=$images item=image}
	<div class="img">
	{if $image->isdir}
		<a href="{$image->file}" title="{$image->title}"><img src="{supersizer path=$image->file|rawurldecode percentage='20'}" alt="{$image->title}" /></a><br />
		{$image->title}
	{else}
   <a class="group" href="{$image->file}" title="{$image->title}" rel="gallery"><img src="{supersizer path=$image->file|rawurldecode percentage='20'}" alt="{$image->title}" /></a>
	{/if}
	</div>
{/foreach}
<div class="galleryclear"> </div>
</div>

But still it's not working.

Re: SuperSizer in Fancybox template (Gallery)

Posted: Wed Apr 28, 2010 3:05 pm
by JeremyBASS
Hmm.. well here is one of the install I have working..


{supersizer path=$image->file|rawurldecode width="500" Subdir="gallery" URL=true Assign="MainPic"}
{supersizer path=$image->thumb|rawurldecode width="58" height=44 Subdir="gallery" URL=true Assign="MinnyPic"}
  title|escape}" rel="CBjQ">title|escape}" />

which produce http://98.129.105.17/index.php?page=gallery

hope that helps.. Cheers -Jeremy