I am trying to get a fixed height for my thumbnails plus add a different class for syling purposes to landscape and portrait thumbs ( similar request as this old post)
http://www.zenphoto.org/support/topic.php?id=3009#post-17980I have tried using islandscape and maxthumb in various configurations and can't get the syntax right.
Does anyone have something similar to this for the latest version of zenphoto
______
if landscape
set height to 200px and add the style class of 'landscape'
if portrait
set height to 200px (same height as landscape) and style class of 'portrait'
Am I missing something really obvious?
Any guidance much appreciated.
Comments
We have `isLandscape()` to check for landscape images.
Acrylian, thank you for getting back to me on this.
I have at this point
if(isLandscape()) {
<?php printCustomSizedImageThumbMaxSpace('',300,100,null,null,true); ?>
} else {
<?php printCustomSizedImageThumbMaxSpace('',100,300,null,null,true); ?>
}
Anywhere near?
thanks!
I actually want 200 height and auto width but I want to be able to apply a class to each thumb for spacing.
so more like
<?php printCustomSizedImageThumbMaxSpace('',300,100,null,landscape,true); ?>
} else {
<?php printCustomSizedImageThumbMaxSpace('',100,300,null,portrait,true); ?>
}
?
"auto width" is no concept the image processor knows of. It needs concrete values. The maxspace functions are meant to define a max width and max height "box" no image no matter what orientation it has exceeds. So `printCustomSizedImageThumbMaxSpace('',100,300,null,portrait,true);` means no image gets higher OR wider than the max width/height. IMHO the landscape check is not neeeded.
Great thank you. I now have image thumbs with maxspace.
I was also trying to get this on albums and used printCustomAlbumThumbMaxSpace
One thing ( i am not sure how to describe this so it makes sense?) I also want to add a class with different padding and margins for portrait and landscape but can't get the if statement to work.
'<?php if(isLandscape())) { ?>
<?php printCustomSizedImageThumbMaxSpace('',100,300,landscapesytle,null,true); ?>
<?php } else { ?>
change to portrait css
<?php } // end ?>'
I think this may not be working as it is inside another if/while and while and
'<?php endwhile; ?>'
Is there some other method of adding a different CSS class to landscape and portrait.? Am I overcomplicating this?
BTW... thanks so much again for your help.
It does not matter that it is within the while loop (next_image I assume).
I have one last thing tripping me up.
Is there a quick fix to add the title="(getImageTitle()," to the image tag. I have it for alt="" but require it for the title?
The bespoke theme uses jquery and requires the title in the image to work.
<?php if(isLandscape()) { ?>
<?php printCustomSizedImageThumbMaxSpace(getImageTitle(),320,200,'landscapesytle',10,true); ?>
<?php } else { ?>
<?php printCustomSizedImageThumbMaxSpace(getImageTitle(),320,200,'portraitsytle',20,true); ?>
<?php } // end ?>