Help Center

Powered by Minitek FAQ Book
Loading...

Control/Image Height, seeing different heights based on data source

SD
Steve DinglePosted 1 year ago

Apologies in advance for what I am sure is a stupid issue on my side. Also I just realized I never flagged old questions as resolved, have done so now

My goal is to display different sets of images on different pages. The following is the set up I have in the link I have sent you.

  • All 3 Module uses Widget of same name, I have Show Title on
  • Module are all set to Title position (SP Page Builder)
  • The Search module is the what I am looking for, but using a different set (folder) of images
  • Home Owner and Home Owner 2 widget is a copy of Search widget.
  • Search and Home Owners are set to same data source (Folder)
  • Home Owners 2 are set to different data source (Folder)
  • No class suffix used in any modules, so no values are changed via css
  • I have verified that every image (png) in the both data source folders is height 100px

Basically I would like Home Owners 2 to be the same height as the other 2

Cheers

Loading...
0
#3944

9 answers

M
MinitekPosted 1 year agoModerator

Hi Steve,

So, I see that all three widgets are configured to display 6 columns (6 items on screen).

This means that the total width of the widget will be equally divided to 6 items.

Now, even though all images have the same height (100px), they don't have the same width. So, each image will be automatically resized to fit in the item column (1/6 of total width). Since some images are resized, their height also will not be 100px anymore.


If you want to make sure that all items have the same height, you can do one of the following:

1. Enable Crop images in the widget parameters so that all images have the same width and height, or

2. Use original images that have the same width and height.

SD
Steve DinglePosted 1 year ago

Ah, it makes sense when you explain it. I'm guessing then I just got lucky with the 1st batch of images. Since the 2nd batch are kinda logos I can't really crop so I will just have to adjust image/canvas size to make them all the same dimension. Will do a few, see how it looks.

Sorry to have bothered ya with a such a simple question. I'm just real ignorant when it comes to dealing with images, for some reason working with them has always been troublesome and confusing to me.
Cheers

M
MinitekPosted 1 year agoModerator

No problem! Happy to help.

Let me know if you need more help.

SD
Steve DinglePosted 1 year ago

Since you asked ;-), I could some more help regarding the height of the slider. I really need to have consistency across pages/articles and I have a situation where I will only have one image to display in the slider. So I changed the Responsive Image per page to one, which didn't work out well as even though the image was 90x100, the slider filled half the page.

So I am hoping you can give me some strategy where I can get consistent height of slider, across multiple pages with different number of images. If I have to make all images the exact same size I will deal with that but I really need the slider to be same height.

Should I be looking at CSS, using the class suffix to control the height or do I need to do some math and change the Responsive values based on number of images to be displayed assume all images would be 100 x 100 or something like that.
Cheers

M
MinitekPosted 1 year agoModerator

Hello,

I think the best solution would be to use a class suffix fixed_height and add the following css:

.mslider_main.fixed_height .mslider-photo-link img {
  height: 100%;
  width: auto;
  object-fit: none;
  max-height: 100px !important;
}
SD
Steve DinglePosted 1 year ago

Thanks so much, didn't really expect code, Minitek rules :-)

 

M
MinitekPosted 1 year agoModerator

You're welcome.

SD
Steve DinglePosted 1 year ago

Hi,

Sorry for necroing old post but just wanted to say I finally got the time to try the code you gave me above. Since my images of of varying widths the more images I add the worse it looked, the above worked a treat!

I did have one issue, 90% of my images are w250+ x h100 but some are square 100x100 and those were all showing left justified. I did some googling and found that adding

 margin: auto;


... centered them. Not sure if that is the correct solution, my css skills are minimal, but it did seem to work without any negative effects

Thanks again for your help in this matter. really enjoying your slider :-)
Cheers
Steve

M
MinitekPosted 1 year agoModerator

Hi Steve,

Yes, margin: auto; is perfectly fine for centering an image.