Member
Member
lainyrache   2013-06-03, 16:10
#1

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.

Administrator
Administrator
acrylian   2013-06-03, 17:13
#2

For fixed height/widths within w x h you can use the set of maxspace functions. What is the exact code you are using?

We have isLandscape() to check for landscape images.

Member
Member
lainyrache   2013-06-04, 16:28
#3

Hi
Acrylian, thank you for getting back to me on this.
I have at this point
if(isLandscape()) {

} else {

}

Anywhere near?
thanks!

Member
Member
lainyrache   2013-06-04, 16:38
#4

( 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 {

}

?

Administrator
Administrator
acrylian   2013-06-04, 18:09
#5

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.

Member
Member
lainyrache   2013-06-05, 14:19
#6

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.
'

Administrator
Administrator
acrylian   2013-06-05, 14:48
#7

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).

Member
Member
lainyrache   2013-06-06, 13:53
#8

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.

Administrator
Administrator
acrylian   2013-06-06, 14:16
#9

Use the get variant and build the `` tag directly: http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetCustomSizedImageThumbMaxSpace

Member
Member
lainyrache   2013-06-06, 15:17
#10

that did it.. smashin! thank you..

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.