Just this: Is there any way to show 2 rows of items?

Comments

swim’s picture

Check out the #items option, http://owlgraphic.com/owlcarousel/#how-to.

chefnelone’s picture

As far as I see the #items option is used to set the numbers of items in ONE row, but not useful to set how many rows, am I right?

doxigo’s picture

I'd like to know the answer to this one as well

chefnelone’s picture

StatusFileSize
new55.67 KB

Something like this:

image

chefnelone’s picture

Category: Support request » Feature request
swim’s picture

I'm going to keep this open as splitting the view content into multiple rows is possible I just don't have the time to implement this feature. Hopefully these resources can help;

chefnelone’s picture

I just checked the docs, it seems to be possible. Maybe this can be done by just doing some modifications in the js that fire up the carousel, am I right?

doxigo’s picture

So anyone came up with a solution to achieve this in Drupal?

samerjh’s picture

Here is another example made in html, I wonder how can we wrap each two or three rows in a div in views tpl file, in this way we can get the carousel in multiple rows

http://jsfiddle.net/Owl/TWtwt/

samerjh’s picture

Hi,

I found the solution for my previous question :)

First of all you need to create an "unformatted list" views (not owl carousel view).

then.. Create new tpl file (views-view-unformatted.tpl.php) which is correspond to your view name for example (views-view-unformatted--MyList--block.tpl.php)

in the file add the following code: (i got this hint from http://drupal.stackexchange.com/questions/71420/views-apply-a-wrapper-to...)

<?php
$group_nr = 1;                  // first group number
$last_row = count($rows) -1;    // last row
$wrapper  = 2;                  // put a wrapper around every 2 rows
?>
<?php foreach ($rows as $id => $row): ?>
    <?php if ($id % $wrapper == 0) {print '<div class="group group-'.$group_nr.'">'; $i = 0; $group_nr++; } ?>
    <div class="views-row-<?php print $id+1; ?>">
        <?php print $row; ?>
    </div>
    <?php $i++; if ($i == $wrapper || $id == $last_row) print '</div>'; ?>
<?php endforeach; ?>
?>

and then in your Js code add the following

 $(".CLASS_OF_THE_VIEW.ANOTHER_CLASS_FOR_DISPLAY_IF_NEEDED .view-content").owlCarousel({
                navigation: true,
                pagination: true
            });

Best

wafer’s picture

Assigned: Unassigned » wafer
Issue tags: +views, +owl carousel

I myself trying to patch this option for future release.

sumthief’s picture

Status: Active » Needs review
StatusFileSize
new5.53 KB

Hi! I've faced with this problem and tried to make a patch.
This patch provides 3 new settings:
1. Rows number
2. Rows margin (dirty hack, if someone can improve it, please do it)
3. Rows output style (column/string).
So you can output items in multi rows, also you can set margin between rows and select output style.

sumthief’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
sudishth’s picture

Status: Needs review » Reviewed & tested by the community

#12 working for me

jaesperanza’s picture

This works great! Thanks, sumthief, chefnelone! Just some CSS and layout is perfect!

anybody’s picture

Status: Reviewed & tested by the community » Needs work

Sorry but this patch doesn't seem to be clean enough to be commited with its TODOs etc. We'll keep it "Needs work" and available as patch for anyone who needs this, until the patch is clean.

Thank you all very much for you work on it.