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.
I was able to fit multiple items into one li for flexslider using the following technique in a view tpl. Feedback? Ideas?
<?php print $wrapper_prefix;
<?php if (!empty($title)) : ?>
<h3><?php print $title; ?></h3>
<?php endif; ?>
<?php print $list_type_prefix; ?>
<?php
$count = count($rows);
foreach ($rows as $id => $row):
//if id/3 is an integer print opening li tag
//print row
//if id+1/3 is an integer or id+1 = count print close li tag
?>
<?php if (is_integer($id/3)) : ?>
<li>
<?php endif; ?>
<div class="row <?php print $classes_array[$id]; ?>">
<?php print $row; ?>
</div>
<?php if (is_integer($id+1/3) || ($id+1 == $count)) : ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php print $list_type_suffix; ?>
<?php print $wrapper_suffix; ?>
Comment | File | Size | Author |
---|---|---|---|
#34 | screenshot-flexslider-carousel.png | 86.02 KB | MmMnRr |
#27 | flexslider-settings.png | 34.85 KB | scotwith1t |
#21 | Screenshot at 2014-03-04 13:21:13.png | 480.09 KB | panditvarun20 |
Comments
Comment #1
minorOffense CreditAttribution: minorOffense commentedv2 has support for showing multiple items per slide in the library. So this will be possible without having to make any template modifications.
For v1, this is probably the best solution.
Comment #2
sidharth_k CreditAttribution: sidharth_k commentedYou mention that v2 has support for showing multiple items per slide in the library -- can you explain how I can show multiple items per slide? Which module do I use -- the standalone flex slider views plugin or the views_slideshow sub plugin ?
Comment #3
doublejosh CreditAttribution: doublejosh commentedAssume that this is just merely in the library and no view support exists.
Perhaps the use of grouping in views could get some folks there, however I need to do it simply by number cluster...
Show 5 items, click/touching next will shift it over by one (or more).
Comment #4
Malman CreditAttribution: Malman commentedIs anybody find the way to make it with V2 ?
Pls.
Comment #5
gghh2 CreditAttribution: gghh2 commentedFlexslider v2 beta let us to create carrousel but we have to wait for the intergration in views.. i guess :(
http://flex.madebymufffin.com/examples/basic-carousel.html
Comment #6
minorOffense CreditAttribution: minorOffense commentedThe carousel should be working. Check the flexslider_example module found within it. There should be an example carousel in there.
If not, let me know and I'll create an example for it and add it to the module.
Thanks!
Comment #7
Malman CreditAttribution: Malman commentedCan you please show us an example of how to select number of item per slide in views creation please ?
Thanks
Comment #8
doublejosh CreditAttribution: doublejosh commentedTurns out this is readily available in http://drupal.org/project/views_slideshow
Comment #9
minorOffense CreditAttribution: minorOffense commentedI can confirm this works with FlexSlider. You can wrap whatever you want in the li and it will appear in the slideshow. You can use the carousel mode to show multiple items at once.
I'll make a note to add more documentation and display text to explain how to do this.
Thanks.
Comment #10
stoan CreditAttribution: stoan commentedI wish to implement this on my site as well, any progress on the documentation? Thanks
Comment #11
jenlamptonI took the same approach as the original poster, but instead overrode
flexslider-views-slideshow-main-frame-row.tpl.php
Here's my code if anyone else needs to do the same:
Comment #12
anni CreditAttribution: anni commentedUsing your code 2 images are displayed. One is sliding but the other stays and doesn´t change.
How can i change it to slide 2 ore more images?
Thanks in advance!
Comment #13
minorOffense CreditAttribution: minorOffense commentedThe carousel docs for Flexslider are here
http://flexslider.woothemes.com/carousel-min-max.html
You just need to set those values in your option set to have it display. I'm working on a client site which will need flexslider and some display text so I'll (finally) get to write up some docs on how to get non-image slides to work.
Comment #14
minorOffense CreditAttribution: minorOffense commentedComment #14.0
minorOffense CreditAttribution: minorOffense commentedtypo
Comment #15
konrad_u CreditAttribution: konrad_u commentedIt's worth noting that in order to show multiple images in flexslider via views one has to specify item width in flexslider options, otherwise it will only scroll one item... at least that was my case
Comment #16
panditvarun20 CreditAttribution: panditvarun20 commentedThank you for the response.
But I want to show the 12 images in 3*4 table by using flex slider. How can I get it. Actually I want to show 12 images in thumbnail with slider so that next 12 images shown on NEXT click. Can it be done by flex slider.
Comment #17
konrad_u CreditAttribution: konrad_u commentedyes it can be done. Try setting Item width (ex. 80) Minimum Items (12) and Move (12) under /admin/config/media/flexslider/list/*/edit
Comment #18
panditvarun20 CreditAttribution: panditvarun20 commentedThank you zeglar.com, But this shows all 12 items in a single rows while I want these 12 items in 3 rows & 4 columns (as 12 images shown in grid).
Comment #19
konrad_u CreditAttribution: konrad_u commentedSimplest way to accomplish this is to just create 3 flex sliders and sync them together
Comment #20
panditvarun20 CreditAttribution: panditvarun20 commentedAppreciating your answer but please can you tell me how can I achieve this functionality. I have 12 different node's images.
Comment #21
panditvarun20 CreditAttribution: panditvarun20 commentedI am sending you the snapshot of my problem so that you can understand what actually I want to say.
This is actually I want to do.
Comment #22
konrad_u CreditAttribution: konrad_u commentedOh. Add 3 image fields in views. you'll have to do some css magic but that should solve your problem
Comment #23
ABaier CreditAttribution: ABaier commentedMentioning the width settings in #15 was a good point. I already started hacking around in the CSS to get it working … Is there a possibility to integrate the slideshow with fixed height instead (and proportional width = auto)? I need the slideshow to handle mixed portrait and landscape images at a time. Now the landscape pictures are scaled to the width, but should have the same height as the portraits.
Thanks for your help.
Comment #24
ABaier CreditAttribution: ABaier commentedI could adjust the images to the same height with CSS, but the pre-calculated width of the container and the anchor points for the sliding transitions are messed up now. Any advice?
Comment #25
konrad_u CreditAttribution: konrad_u commentedhey toni,
do you have a live example? I could take a look at your css and see if I can find a trick ... you can private contact me too
Comment #26
marcoscanoJust extending the solution in #11. Note that the file
flexslider-views-slideshow-main-frame-row.tpl.php
comes from the "flexslider_views_slideshow" module, which is now a separate module.Comment #27
scotwith1tThis just isn't working for me. I set the options as seen in the attached screenshot. What am I doing wrong?!? The way it's set up I'd expect it to behave like the example on the flexslider page in #13 but it's just not. I'm using the latest dev. Please help if you can? Sorry to change the status if it's working as it should and it's just me...totally possible. The view is set up to show all items, this seems to say it will grab between 2 and 6 items and scroll by the currently visible number of items. Seems that the item width should be 300 and margin of 10, but I get a single image, whose imagecrop is 300x300, which is stretched to 100% width (the 300 isn't being applied) and the controls only go through 5 of the items (even though the markup is there for all 9 items in the view before looping back to the first, so I'm not even getting it to cycle through all the items in the markup!?
Comment #28
mesnitu CreditAttribution: mesnitu commentedI had some troubles, but at the end was the items width. Now it's working as it should.
Comment #29
Mod74 CreditAttribution: Mod74 as a volunteer commentedPlaying with the Item Width setting fixed it for me in the end. I had to enter a px setting (i.e. "200px", not just "200")
Comment #30
scotwith1tI've tried every combination I can think of and still can't get it to work. px, no px, min and max # of items with different values, tried some css to fix it, nothing doing. can someone post an example of this working and the config screen to show an example of this functioning properly? Using the latest alpha3, flexslider 2.4 and libraries 2.2.
Comment #31
konrad_u CreditAttribution: konrad_u commentedscotself: If you're using views make sure under image field configuration 'Display all values in the same row' in unchecked under 'Multiple field settings'
Comment #32
scotwith1tExcept this isn't a multi-value field. It's a single value image field from a content type. Just showing all the logos, need that slideshow responsive and multiples per slide. Each logo just links off to the organization's full page.
Here's the exported view if that helps at all:
Comment #33
konrad_u CreditAttribution: konrad_u commentedscotself: Your view seems fine. I just used latest dev of flexslider on a project using views and everything works as designed. Feel free to PM me. I'll be happy to take a look at your site and try to help you out
Comment #34
MmMnRr CreditAttribution: MmMnRr commentedComment #35
MmMnRr CreditAttribution: MmMnRr commentedHi everyone,
After a lot of work, I could configure in Drupal 7 a FlexSlider with a Carousel with multiple items.
Each item is defined in its own "li", so I did not merge multiple items inside the same "li".
Basically, I followed this tutorial in order to configure the creation of the FlexSlider through JavaScript code. Then, I created a View with an Unordered List (UL with LI elements) of images that will appear on the FlexSlider Carousel. That view does not have any specific configuration regarding the FlexSlider Drupal module. The view does not use that module.
My JavaScript code looks as follows:
After saving the View and flushing all caches I obtained the following slider:
Some assumptions and comments:
1) The arrow icons (next/prev) are customized. So they do not appear in the original FlexSlider CSS file.
2) In order to make the "itemMargin" option to work, you need to specify a CSS declaration for the "ul.slides li" elements with the same "itemMargin" value:
3) If you want, you can specify specific display behaviour for your carousel images. For example, you can use Shadowbox module in order to enlarge each image when you click over them.
Comment #36
ec-adam CreditAttribution: ec-adam commentedI was trying to do this same thing for a logo-slider, Drupal 7 > Views 3.
Was able to do it out-of-the-box with no custom code (other than some theming for polish), but it wasn't obvious and actually took a could of hours of blind-squirrelling it.
Flexslider settings as follows:
Starting Slide = 1
Item Width = 100px
Item margin = 10px
Minimum Items = 2
Max Items = 10
Move = 1
Animation = Slide (this was the sticker that I couldn't find in any other posts—default flexslider is fade, and that will constantly 9and ovbiously) only allow one image at a time. Setting to 'slide' along with the rest of the options above, works like a charm).
Hope this helps someone.
Comment #37
AlfTheCat CreditAttribution: AlfTheCat commented@ec-adam.... thank you. thank you. thank you. I could spend 40 hours writing thank you to you and still save time compared to hunting this problem down on my own. That slide / fade option did it!
Comment #38
trentl CreditAttribution: trentl as a volunteer commentedI can also add a bit THANK YOU to @ec-adam for noting the option of "slide" as a sticking point. Without this setting the mutli-slide option carousel will not work.
Comment #39
amaria CreditAttribution: amaria commentedComment #40
bond708 CreditAttribution: bond708 commented@ec-adam tx, saved a lot of time