When I set a block with views_slideshow, the height of the block change depending on the content showed, moving the rest of the blocks up/down, an ugly effect. Is there a way to keep the height of the slideshow block fixed?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

manimal’s picture

yes, I'm wondering this too. it would be very handy.

justin3’s picture

you can do it with with css- open /themes/mytheme/style.css

add something like this at the bottom
#block-views-myblock {height: 250px !important; overflow: hidden;}

where block-views-myblock is the div id of your block, which can be found by highlighting the block, then rt-click - 'view selection source' (in firefox)

jokerejoker’s picture

Assigned: Unassigned » jokerejoker

This solution is not a very good!

What if have teasers in the slideshow and 'read more' link at the bottom, this 'read more' link would disappear.

The best solution would be to let the js highest element in the slideshow and set the wrapper to that height.

I will try to make a patch for D6 (I'm not familiar to D5, sorry!)

jokerejoker’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
FileSize
3.97 KB

I have created this patch that gives the option to have a fixed height of the slideshow block

jokerejoker’s picture

Status: Active » Patch (to be ported)
jokerejoker’s picture

Status: Patch (to be ported) » Needs review

Maybe a better status, sorry hehe :)

jokerejoker’s picture

Assigned: jokerejoker » Unassigned

Maybe I should not be assignee for code review

dragonwize’s picture

What is this patch trying to achieve that CSS will not do?

The style height of the block can be set through your theme with one line of code. Content can be of all sizes and can easily get messed up unless you already know at least the maximum size of all possible content in the slideshow.

jokerejoker’s picture

This patch calculates the maximum height of any element in the slideshow.

Thereafter the resulting height is set with css ... as your solutions have done as well.

The patch also provides an option to enable/disable the fixed height, which is found in the "views setup" as a point'n'click feature.

Durran’s picture

Another possible solution would be to add the slide-show to a mini-panel block, and hard code the INC. files within the "styles" folders under panels.

dddave’s picture

Is there any chance that this feature could be implemented? It sounds very userfriendly especially for all folks not so comfortable with CSS.

nirvanajyothi’s picture

Would be helpful for non-programmers if there is a simple UI for setting block dimensions. It is present in Rotor module http://drupal.org/project/rotor .

tryitonce’s picture

Sorry to say, I switched to Views Rotator - http://drupal.org/project/views_rotator - that allows to set the height and if no height is set it will attempt to calculate a fixed height.
The auto height calculation worked well for me and thus I will keep it for now.

I am sorry, because Views Slideshow looks great with all those controls.

I first made the switch because Views Slideshow suddenly stopped and seemed buggy - well simplicity is usually the better option.

I think for a slideshow the fixed height for blocks is paramount and it would be good to fix this quickly to get it out of the mind of the less programming minded users like me.

Good luck and thanks - I will keep the moduel active to stay in touch ....

Shai’s picture

Title: Fixed height in slideshow blocks » Easy Solution Using Imagecache

This problem is very easy to address if you use the imagecache module. Because so many people use imagecache it seems efficient that code solutions to fixed heights/widths would not be implemented in this module.

Solving the problem with Imagecache
First create a "preset" using the imagecache admin (admin/build/imagecache/add). Then, in Views, when you select the image field that you'll be using for the slideshow, there is a dropdown called, "Format." That dropdown will list the preset you've just made, and voila, no worry about bad sized pics ruining your layout.

Also note that there is a lot of work being done on this module --- currently you have to checkout the 6--2 dev from cvs and apply this patch from the following thread in order to see all the improvment, bug fixes etc. http://drupal.org/node/463254. But hopefully it will be downloadable from the project page soon.

Shai
Content2zero Web Development

Shai’s picture

Title: Easy Solution Using Imagecache » Setting a Fixed Height in a Slide Show

On my last comment I forgot I was here in the queue and I thought I was just doing a regular comment where you can add a title. I didn't mean to change the title of the whole thread.

Shai

tryitonce’s picture

Thanks for the advice - I will try it out before too long.

tryitonce’s picture

Shai,

thanks for the easy to follow note and guidance.

I tried your suggestion to realise this refers to images.

But my need is a combination. I am generating a show of certain details from the input of the sponsors / Advertisers. I use the logo (image field) and two text fields - of varying length - one with 9 lines, one with 2.

When this is put together in Views each produced image of the Sponsors details will look different from no logo and some lines of text to logo and all 11 lines.

At the end this combined view needs to have fixed height for the block in the sidebar. Views Rotator is doing this well right now. But there is another area where I will need just slides - so many thanks ... and more when I get to that little excersise ...

redndahead’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Moving to 2.x

gregarios’s picture

I just want to request that there be a setting to opt-out of this! I was always able to fix the height using css on my site, but UN-fixing it is impossible if this patch is implemented. (which it appears it is) I don't want mine to be a fixed height, as I want my total column height to reduce as much as possible if it can, on some slides, since I'll only be switching slides very slowly.

Please provide a setting to disable this function if you would.

fearlsgroove’s picture

@gregarios - I agree with your thought, I think generally this should be handled through css/theming and tools like imagecache. There is some value in having this be quite easy for non-coders/themers tho. If implemented it should definitely by optional.

gregarios’s picture

Yes. It is even more important to have it optional when you aren't just sliding images, but whole teasers or nodes. When you are sliding teasers, the height can vary quite a bit from slide to slide. When a fixed height is implemented, some teasers have a huge gap of space under them with a fixed height, while a dynamic height makes the rest of the column adjust and keep the gap from appearing.

redndahead’s picture

Status: Needs review » Fixed

Since moving to jQuery cycle it seems to be fixed height by default. So this should be fixed in 2.x-dev

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

IncrediBody.com’s picture

I just upgraded to 2.x, and the fixed height adds gaps to my block content. Is there a way to disable the fixed height? If not, would I need to install v1.x in order to prevent this fixed height from occurring?

Thanks!

redndahead’s picture

In the advanced settings box enter

containerResize: 0

IncrediBody.com’s picture

Thanks for the reply. I tried adding containerResize: 0 to the advanced box in the slideshow style for the appropriate view, and the block is still stretched to fit the maximum height. Any idea why this may not be working for me?

Thanks again for your help!

jessehs’s picture

I've been trying to figure this out as well. I've got an imagecache preset of 520px height for all images, yet all of the (div id="views_slideshow_singleframe_div_1_[slide#]") slides as well as the slideshow container (div id="views_slideshow_singleframe_teaser_section_1") are given a fixed height in their style="height: 525px;" inside both divs.

So, JavaScript is assigning the height of these DIV's, correct? I've tried putting both height: 520 and containerResize: 0 in the advanced settings box to no avail. Why are the 5 extra pixels added on to these two DIV's?

jessehs’s picture

I figured out what was causing my problem, at least -- it was my CSS: Setting line-height: 0px; fixed the issue.

redndahead’s picture

IncrediBody, Try this patch: http://drupal.org/node/632838#comment-2265562 and then set containerResize:false

If you still have issues please open a new issue.

hixster’s picture

Hi , I'm confused :-S

I'm running 6 x 2 x dev and have not patched my module.

I am experiencing fixed height for variable height images in a slideshow. I would like the container block to resize image it is containing.
I have not modified my css

I have tried adding

containerResize: 0
&
containerResize: false

What am I doing wrong? Do I need to patch to have my container automatically resize?

hixster’s picture

I've doubled checked i'm using 6x-2.x-dev which includes the patch suggested.

None of my advanced arguments seem to get processed.. Doesn't seem to make any difference what I put in the arguments field, i always get the same reults. ie: The largest image in the slideshow is used for the overall size of the slideshow, leaving huge gaps to the controls for smaller images.

hixster’s picture

- bump --

Can anyone help with posts #30 & #31?

psynaptic’s picture

So you would prefer it if the controls moved up flush with the bottom edge of the image, depending on its size? This would mean the controls move and the user has to struggle to keep up with where the controls moved to. This seems like bad usability.

hixster’s picture

- I would like the option to choose.

I actually prefer the the controls at the top, but I prefer not to have a massive blank space below the slideshow to the rest of the content when smaller images are being shown.

gregarios’s picture

So you would prefer it if the controls moved up flush with the bottom edge of the image, depending on its size? This would mean the controls move and the user has to struggle to keep up with where the controls moved to. This seems like bad usability.

There are situations where this is desired, like when there are no controls visible, or when they are above the slides -- especially on slowly rotating content. Usability is often up to the admin. Capability is nice to have, so usability can be changed to suit different needs.

psynaptic’s picture

Right, I see. I suppose having the option would be best so people can choose which to use.

hixster’s picture

FileSize
146.78 KB
126.62 KB

Here are 2 images that illustrate the issue. I have a contact form at the bottom of the page that I'd like to sit at the bottom of the slideshow view area whatever the image size.

hixster’s picture

Any one got a fix for the fixed height issue then? the posts above allude to the fact that fixed height is an option, can anyone confirm that the advanced options work?

hixster’s picture

<-- Bump -->

Still unresolved, can't we have the old behaviour back : ie no fixed height

psynaptic’s picture

We need the ability to more easily swap the slideshow script, then you can have your variable height back :)

hixster’s picture

Redndahead is saying that the patch fixes the fixed height issue, but that doesn't seem to be the case for me...

http://drupal.org/node/607424

redndahead’s picture

Priority: Normal » Critical

Marking as critical to look at before release.

redndahead’s picture

Status: Needs work » Fixed

I commited a patch in #607424: advanced: height:150; not working that fixes some problems we had with numerics in the advanced settings box. This should fix this issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

staff_whyte’s picture

Hey #28, where did you ad this in your css? I have same issue

calebm12’s picture

Has anyone found a solution for what is referenced in posts #30-36??
I am using the slideshow to rotate through quotes and it looks silly when the largest quote sets the height of the box.

iTiZZiMO’s picture

Version: 6.x-2.x-dev » 6.x-3.0

Hello Community,

first of all - i would like to thank you for the great module !

Unfortunately we have the same bug on our drupal 6 site, using the latest stable version:

see
https://beta.ushine.de/?f%5B0%5D=sm_city%3AM%C3%BCnchen

The first slide is only 35px height - after several times, the slideshow comes back to normal height.

Any Idea?
Kind regards.