gladio

[Solved 6r]multiple items in a bt-row

8 posts in this topic

Hi, I'm using bt content slider to slide a grid of element.

The code in root\modules\mod_bt_contentslider\tmpl\default.php (starting form line 41),

generates a <div class="bt-row"></div> for each item of the $list.

Instead, I need to have "the number of item setted in the manager side" per row (in this case is 3, so 3 item per row).

How can I write the code to do it?

Share this post


Link to post
Share on other sites

Hi

I don't understand your mean.

BT content slider allow you set item per row and column. So how is yours different ours?

Hi, thanks for the reply!

As you can see in the demo page (http://extensions.bo...tentslider.html)

if you set the number of rows, for example, to 3

If you inspect the html with firebug you can see that there is a <div class="bt-row"></div> for each element

<br/><br/>

b395.png

Instead i need to have 3 elements* inside each row...

*the number of element setted in number of cols

Share this post


Link to post
Share on other sites

Hi

Please try this solution

Replace this line in file /tmpl/default.php

<div class="bt-row <?php if($i==0) echo 'bt-row-first'; else if($i==count($list)-1) echo 'bt-row-last'?>"  style="width:<?php echo $itemWidth;?>%" >

to

<div class="bt-row <?php if($i==0) echo 'bt-row-first'; else if($i==count($list)-1) echo 'bt-row-last'; else if (($i + 1) / $itemsPerRow == 0) echo 'bt-row-last-row'?>"  style="width:<?php echo $itemWidth;?>%" >

You will has class bt-row-last-row for last article of each row. You can still style it in your idea.

Share this post


Link to post
Share on other sites

Hi

Please try this solution [...]

Very thanks tronghm!!

I've found also another method, if it can helps someone else:

I've modify this (line 116)


<?php
if($itemsPerCol > 1 && $i < count($list)-1){
if(($i+1)%$itemsPerRow ==0){
echo '<div class="bt-row-separate"></div>';
}
}
?>

like this:


<?php
if($itemsPerCol > 1 && $i < count($list)-1){
if(($i+1)%$itemsPerRow ==0){
echo '<div class="bt-row-separate"></div></div><div class="bt-row" >';
}
}
?>

so every time it adds the <div class="bt separate"></div> after every X elemets,

it also closes and reopen the <div class="bt-row">.

Hope this helps, and thanks a lot for your help!!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now