Im currently getting to the end-stage of my theme development. However, Im having a few problems with this, namely in getting a jcarousel like view style but with 2 rows instead of one. With the following jcarousel-view.tpl.php in my theme folder, I was able to somewhat get further:
<?php
/**
* @file jcarousel-view.tpl.php
* View template to display a list as a carousel.
*/
?>
<ul class="<?php print $jcarousel_classes; ?>">
<?php $i=0; $rows_number=2; //you can change the number of rows ?>
<?php foreach ($rows as $id => $row): ?>
<?php if($i%$rows_number==0) : ?>
<li class="<?php print $classes[$id]; ?>">
<?php endif; ?>
<?php print $row; ?>
<?php if($i%$rows_number==($rows_number-1)) : ?>
</li>
<?php endif; ?>
<?php $i++; ?>
<?php endforeach; ?>
<?php if($i%$rows_number!=0) : ?>
</li>
<?php endif; ?>
</ul>
Here is the end result: http://static.inky.ws/image/2302/image.jpg
As you can see, it group each set of fields for each item into a common column. So I cannot create a full border for each individual item. (See: http://static.inky.ws/image/2303/image.jpg for an example of what Im trying to achieve code-wise)
I can get a grid view but it means changing my view's style to use "Grid", which costs me from using jcarousel. Does anyone have any suggestions on how I can improve my code above? Im thinking that the unordered list markup might not be helping me any.
Comments
it looks like each row is an
it looks like each row is an html li element, why not apply the border to that?
Well, I dont want to apply a
Well, I dont want to apply a border to the LI because it will continue to look the way it has, where its just one border for both items in a column. Im trying to seperate that border to a per-item basis instead
I need something to enclose each item's Image & Title within the ul, li structure. Once I can isolate each item from the items that share its "column", Id be in business.
what about adding a wrapper
what about adding a wrapper div?
If I can add a div inside the
If I can add a div inside the ul and li tags, than yes. Any idea how to adjust my template code to do so?
what about changing<?php
what about changing
to
That seems to work great,
That seems to work great, thanks Nevets!
thanks a lot!
thanks a lot!
This code works for Drupal 7, only need to change $classes[$id] to $row-classes[$id].
add spacing between rows
How can i add spacing between the 2 rows, i'm having a little difficulty...
You should be able to use css
You should be able to use css to had a bottom margin to a row.
add spacing between rows
Okay, but wouldn't that affect both rows if i use css to alter the bottom margin? and which class do i add the bottom margin to?