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-17980
I 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.
Hi
Acrylian, thank you for getting back to me on this.
I have at this point
if(isLandscape()) {
} else {
}
Anywhere near?
thanks!
( sizes are just sample to check if it works)
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
} else {
}
?
Generally that is correct regarding the landscape (please think of escaping code examples using backticks).
"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.
HI Acrylian
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.
'
You are doing it correctly, except that the class name should be within quotes (strings always must) and there is one bracket too much in the if (you should get an error on that, unless it is just a typo here).
It does not matter that it is within the while loop (next_image I assume).
That was it. I missed the extra bracket and the quotes. Thank YOU!
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.
Use the get variant and build the `` tag directly: http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetCustomSizedImageThumbMaxSpace
that did it.. smashin! thank you..