Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#37 | image_1.jpg | 126.62 KB | hixster |
#37 | image_2.jpg | 146.78 KB | hixster |
#31 | Screen shot 2010-02-06 at 09.42.12.png | 51.72 KB | hixster |
#31 | Screen shot 2010-02-06 at 09.40.07.png | 52.47 KB | hixster |
#31 | Screen shot 2010-02-06 at 09.40.19.png | 84.62 KB | hixster |
Comments
Comment #1
manimal CreditAttribution: manimal commentedyes, I'm wondering this too. it would be very handy.
Comment #2
justin3 CreditAttribution: justin3 commentedyou 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)
Comment #3
jokerejoker CreditAttribution: jokerejoker commentedThis 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!)
Comment #4
jokerejoker CreditAttribution: jokerejoker commentedI have created this patch that gives the option to have a fixed height of the slideshow block
Comment #5
jokerejoker CreditAttribution: jokerejoker commentedComment #6
jokerejoker CreditAttribution: jokerejoker commentedMaybe a better status, sorry hehe :)
Comment #7
jokerejoker CreditAttribution: jokerejoker commentedMaybe I should not be assignee for code review
Comment #8
dragonwize CreditAttribution: dragonwize commentedWhat 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.
Comment #9
jokerejoker CreditAttribution: jokerejoker commentedThis 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.
Comment #10
Durran CreditAttribution: Durran commentedAnother 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.
Comment #11
dddave CreditAttribution: dddave commentedIs there any chance that this feature could be implemented? It sounds very userfriendly especially for all folks not so comfortable with CSS.
Comment #12
nirvanajyothi CreditAttribution: nirvanajyothi commentedWould 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 .
Comment #13
tryitonce CreditAttribution: tryitonce commentedSorry 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 ....
Comment #14
Shai CreditAttribution: Shai commentedThis 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
Comment #15
Shai CreditAttribution: Shai commentedOn 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
Comment #16
tryitonce CreditAttribution: tryitonce commentedThanks for the advice - I will try it out before too long.
Comment #17
tryitonce CreditAttribution: tryitonce commentedShai,
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 ...
Comment #18
redndahead CreditAttribution: redndahead commentedMoving to 2.x
Comment #19
gregarios CreditAttribution: gregarios commentedI 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.
Comment #20
fearlsgroove CreditAttribution: fearlsgroove commented@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.
Comment #21
gregarios CreditAttribution: gregarios commentedYes. 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.
Comment #22
redndahead CreditAttribution: redndahead commentedSince moving to jQuery cycle it seems to be fixed height by default. So this should be fixed in 2.x-dev
Comment #24
IncrediBody.com CreditAttribution: IncrediBody.com commentedI 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!
Comment #25
redndahead CreditAttribution: redndahead commentedIn the advanced settings box enter
containerResize: 0
Comment #26
IncrediBody.com CreditAttribution: IncrediBody.com commentedThanks 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!
Comment #27
jessehsI'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?
Comment #28
jessehsI figured out what was causing my problem, at least -- it was my CSS: Setting line-height: 0px; fixed the issue.
Comment #29
redndahead CreditAttribution: redndahead commentedIncrediBody, 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.
Comment #30
hixster CreditAttribution: hixster commentedHi , 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?
Comment #31
hixster CreditAttribution: hixster commentedI'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.
Comment #32
hixster CreditAttribution: hixster commented- bump --
Can anyone help with posts #30 & #31?
Comment #33
psynaptic CreditAttribution: psynaptic commentedSo 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.
Comment #34
hixster CreditAttribution: hixster commented- 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.
Comment #35
gregarios CreditAttribution: gregarios commentedThere 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.
Comment #36
psynaptic CreditAttribution: psynaptic commentedRight, I see. I suppose having the option would be best so people can choose which to use.
Comment #37
hixster CreditAttribution: hixster commentedHere 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.
Comment #38
hixster CreditAttribution: hixster commentedAny 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?
Comment #39
hixster CreditAttribution: hixster commented<-- Bump -->
Still unresolved, can't we have the old behaviour back : ie no fixed height
Comment #40
psynaptic CreditAttribution: psynaptic commentedWe need the ability to more easily swap the slideshow script, then you can have your variable height back :)
Comment #41
hixster CreditAttribution: hixster commentedRedndahead 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
Comment #42
redndahead CreditAttribution: redndahead commentedMarking as critical to look at before release.
Comment #43
redndahead CreditAttribution: redndahead commentedI 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.
Comment #45
staff_whyte CreditAttribution: staff_whyte commentedHey #28, where did you ad this in your css? I have same issue
Comment #46
calebm12 CreditAttribution: calebm12 commentedHas 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.
Comment #47
iTiZZiMO CreditAttribution: iTiZZiMO commentedHello 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.