I love this module's ease of use and the style it provides Views to rotate through many different spotlights and any other site features you build. Currently when you set your Views Style to "Rotor", you can then select options to provide the width and height of the items that will display in a Rotor block/region. While this works fine in many cases,I think there would be times that it would be very beneficial to NOT have to specify an exact size, and instead it take up the full size of a block/region, presumably expanding to full area provided in your theme's stylesheet for that particular area.
To give an example, I know a couple of my sites have "SpotLight" features that rotate through images that also contain a quick blurb of text. Positioning those items below or beside each other isn't super hard to do with a little bit of themeing, but let's say for instance I have a box below my "SpotLight image" with my info blurb, and that blurb would expand beyond the height chosen on a couple of individual rotor items. I'd be worried it wouldn't display the full content of the Rotor, and enlarging the size of the Rotor itself for the 1-2 items that need extra space would probably make the area look a bit funny in the grand scheme of things.
To give a small example, a small site I maintain has this kind of feature setup, but using a different module (Views Rotator. I'd like to switch this area out with a Rotor View instead, but was concerned that my I wouldn't be able to standardize a height for the different blurbs of text that appear in there. The item is right on the front page: http://www.adversitysg.org/
Would this be a possibility for a future revision/update for the module?
Comments
Comment #1
mrfelton commentedAgreed. As promised, I will begin work on this shortly.
Comment #2
mrfelton commentedThis is fixed in CVS. Setting width and height to 0 remove the restriction on size.
Comment #3
GatorBat commentedThank you VERY MUCH Mr.Felton! That was super fast. I will test this out shortly (probably by this weekend), and report back if I have any problems. Much appreciated for adding this great feature into Rotor banner :)
Comment #5
GatorBat commentedThe Thanksgiving Holiday (and some unannounced deadlines) got the best of me, and I haven't tested out the latest dev. Mr. Felton, do you know if this slight change made it into the "current live" version released on Nov 30, 2009? If so, I'll roll out this update, and test it now that I have some time again. Thanks again for you continued support :)
Comment #6
mrfelton commentedYes, should be in the latest release.
Comment #7
GatorBat commentedAfter having a chance to test things out a bit, I'm happy to report the changes do appear to be working for the most part. I've ran into a three minor snags, which I am unsure if it's my theme (derived from the Genesis starter theme and using their Gpanels feature). The live set running with an updated Views-6.x-2.8 and the latest Rotor-6.x-2.4 can be found at http://www.skillslabsymposium.com/
When you perform a Live Preview with Views, with the Width and Height both set to "0", it does show you all of the items as you would expect. However, it only displays 100px width of content. I'm presuming this is a result of the following snippet of code in the rotor.css
Commenting out the "width" line above then allows the Live Preview to show the full width of the content. With or without that line in the CSS file, the intended width of the block on the actual page renders properly. This is a minor quibble, and I realize that line in the CSS file is probably there for a reason ;)
Without a hard set height (using 0), the overflow: hidden component of the code above seems to be ignored. I have a small block built using the Rotor Style for the "Sponsors" on the right side of every page on the live site. This is currently the only block using the width and height of the Rotor item set to "0". Whenever you load any page on the site, all of the Sponsor Items display for a few seconds (until all have loaded), and then then quickly disappear and the rotation proceeds as you'd expect (it seems to be ignoring the overflow: hidden in the CSS). When a specific height is chosen, this does not occur, presumably because the height prevents the display of the items, or is actually acknowledging the overflow: hidden in the CSS file.
The final issue I've noticed is that roughly 4-5 pixels of height seem to get artificially added to the .rotor-items class when the page is rendered. While I originally chalked this up to my Genesis Subtheme and use of gPanels, I've found the same issue happens in a block placed in the general content area on the default Drupal Garland theme. Using FireBug, I found this code gets generated for the .rotor-items class
The Image is loaded with the correct width (199px) and height (175px), but for the life of me I cannot figure out how these 4 additional pixels on height ONLY appear. FireBug traces it down into an element.style component that refers back to .rotor-items class and .rotor-content class. The same thing happens on the default Garland theme, only there are 5 pixels extra on the height. While I can correct this small nuisance by adding a margin-bottom: -5px applied to the .rotor-items class, I'm pretty certain there's a more appropriate area I should be looking to correct this issue on my end.
My apologies for this long response, Mr. Felton. The work you have already done is fantastic! Any chance you might be able to help me out a bit here? Thanks again for your hard work!
Comment #8
mrfelton commentedThis is an odd one indeed, but I think I have it. Please try with a checkout from cvs and let me know how you get on.
Comment #9
GatorBat commentedI've updated the site with your latest CVS release, and it looks like we have a little bit of forward progress :) When I do the Live Preview of the View, it now displays the full width of each item, and lists each item it should be pulling from the view. Here's an export of that view for the Block we've been examining:
The other 2 items (overflow: hidden issue and the extra height added onto the .rotor-item class) are still present. Please let me know if I can provide any other information, and thanks again for your rapid response time :)
Comment #10
mrfelton commentedAh man, I was thinking that the extra height issue should have been fixed. Make sure all your caches are cleared... If still a problem I'll have another look tomorrow,
Comment #11
GatorBat commentedI cleared my site cache (admin/settings/performance) and my views cache (admin/build/views/tools), and then cleared my browser cache just be certain. No other change than what I mentioned at the top of #9.
Comment #12
mrfelton commentedAs far as I can tell this is actually a problem with views. It outputs a newline after every field. This newline is what gives the extra pixels in height.
You'll notice that in the Rotor css, I have the following:
This removes the extra height when using the Rotor row style - this is why I thought I had fixed your issue. However, because you have your row style set to fields, that css won't be being used, as the Rotor row template won't be in use.
Try adding this into your stylesheet somewhere:
Comment #13
GatorBat commentedPure Genius Mr Felton! I had noticed that addition to the Rotor.css file, and was also a bit puzzled as to why it didn't work. Your suggestion works perfectly now on all of the browsers I have tested except for IE 6, and honestly, I don't think I'd ever ask/expect anyone to be able to fix that broken/aged browser. I am using Fields in that view because I did NOT use the actual rotor content type to create those different images (wasn't sure how well it would work since I needed different sizes of banners and such to work). In order to set my Row Style as Rotor, wouldn't I need to use the built-in Rotor Content Type?
The only other issue (and this may be related to my use of row style set to fields) is that the other items in my view all display until they all have been loaded, and it then of course all collapse back into each other and the show functions normally. Any suggestion on this? Please feel free to tell me if this is out of the scope of the module issue, and is a special case I need to investigate more on my own. Thanks again for your help and support.
Comment #14
mrfelton commentedHi GatorBat,
Glad that worked for you :)
You are right that the Rotor row style is only for use with the Rotor content type (it allows the tab functionality to work). So, if you want to use fields like you are (and you are perfectly allowed to do that!) then you will need to add a rule like that to your css. I think it is a bug in Views really, but until that can be addressed this css hack should work fine.
The thing about all the images displaying at once - I suspect that this is only a problem if you have 0 for wdith and/or height - please can you confirm? (ie. if you set a width and height, that shoudn't happen). This is because when you set a width and height, the overflow:hidden style which is set on the rotor item container causes everything outside of the defined size to be hidden. If you don't specify a size there will be no bounding box to use to hide stuff.
I may be able to set it so that items are hidden by default and then the JavaScript triggers the visibility once they have loaded... can you open another ticket for that issue please?