I am using jCarousel in views to display youtube video preview images (inserted in a given node using cck embed media field). While its working fine (except for minor jCarousel theme related issues which seem solvable), i am not able to think how to hide the carousel when there's nothing to show.. the carousel just comes up with an empty set. i have tried using the "Hide if empty" option in the video field configuration option of views.. doesn't seem to help.

Would appreciate any pointers...

Comments

quicksketch’s picture

Views will automatically hide the entire view if it is truly empty. You're probably still getting individual rows back but those rows are just empty. Try switching your display style to something more visible like a normal unordered list. Then you should be able to more easily see the empty rows being returned. Configure your view so that no rows show up when the whole set is supposed to be empty, then switch back to jCarousel style and you'll see that it works the same as other display styles when the list is empty.

njathan’s picture

Thanks quicksketch.
When an 'unordered list' display style is used instead of jcarousel, empty rows are not returned, hence i presume the view may be configured properly. However, switching back to jcarousel display style again gives a jcarousel block with blank boxes.

I am using the jcarousel view inside a panels page meant for node display (with nid argument et al.).. is that making the difference?

quicksketch’s picture

When an 'unordered list' display style is used instead of jcarousel, empty rows are not returned, hence i presume the view may be configured properly.

I'm going to insist that the unordered list style probably is returning results, it's just that they're empty rows. Set some "empty text" and see if the empty text shows up when the result is empty. The empty text should be used regardless of what style you use, since if the result is empty the display handler (like jCarousel or Unordered List) is never even called at all. The jCarousel module has no power over the display if there truly are no rows being returned, because it isn't ever called.

njathan’s picture

Thanks quicksketch. I think i must have figured a workaround.. or maybe the solution itself. I added a filter of Content-Video is 'not null' and things seem to have got working correctly.

quicksketch’s picture

Status: Active » Fixed

Sweet, thanks for the followup.

Status: Fixed » Closed (fixed)

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

ainz’s picture

I just solved this for myself with a little CSS hack. The placeholders still load but since all placeholders have a class attribute of

jcarousel-container-vertical

i added a the following to my CSS file

.jcarousel-container-vertical {display: none;}

It still loads but of course you can't see it. That's ok for me until I find something better ;)