Yii Framework Forum: Twitter Bootstrap Thumbnail Alignment Issue. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Twitter Bootstrap Thumbnail Alignment Issue. Rate Topic: -----

#1 User is offline   bonnie 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 62
  • Joined: 08-February 11

Posted 05 March 2013 - 08:37 AM

Am having issues with image thumb alignment in the following code The first four thumbnails display correctly but the next four are not in alignment to the first four..
If four images are inside <div class="row-fluid product_listing"> they display correctly before implementing foreach I had image thumbnails hardcoded in each <div class="row-fluid product_listing"> so if I can get the foreach to work that way it will solve the problem. After googling I saw somebody mentioning nested div if someone has Idea please help.
<div class="row-fluid product_listing">
<?php if(!empty($products)) { ?>
<?php foreach($products as $product):?>
<div class="span3">
<div class="item">
<?php
if(!empty($product->images))
foreach($product->images(array('limit' => 1)) as $image)
{
echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl.'/'.$image->image_thumb_path, '',array('class'=>'img')), $product->url);
}else
{
echo CHtml::link('<img class="img" src='.Yii::app()->request->baseUrl.'/uploads/no_images/no_image.jpg  alt="" />', $product->url);
}
?>
<?php echo CHtml::link(CHtml::encode($product->title), $list->url, array('class' => 'title'));?>
</div>
</div>
<?php endforeach; ?> 
</div>

0

#2 User is offline   bonnie 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 62
  • Joined: 08-February 11

Posted 14 April 2013 - 08:55 PM

View Postbonnie, on 05 March 2013 - 08:37 AM, said:

Am having issues with image thumb alignment in the following code The first four thumbnails display correctly but the next four are not in alignment to the first four..
If four images are inside <div class="row-fluid product_listing"> they display correctly before implementing foreach I had image thumbnails hardcoded in each <div class="row-fluid product_listing"> so if I can get the foreach to work that way it will solve the problem. After googling I saw somebody mentioning nested div if someone has Idea please help.
<div class="row-fluid product_listing">
<?php if(!empty($products)) { ?>
<?php foreach($products as $product):?>
<div class="span3">
<div class="item">
<?php
if(!empty($product->images))
foreach($product->images(array('limit' => 1)) as $image)
{
echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl.'/'.$image->image_thumb_path, '',array('class'=>'img')), $product->url);
}else
{
echo CHtml::link('<img class="img" src='.Yii::app()->request->baseUrl.'/uploads/no_images/no_image.jpg  alt="" />', $product->url);
}
?>
<?php echo CHtml::link(CHtml::encode($product->title), $list->url, array('class' => 'title'));?>
</div>
</div>
<?php endforeach; ?> 
</div>


I decided to switch to list view.
0

#3 User is offline   waterloomatt 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 545
  • Joined: 09-April 10

Posted 14 April 2013 - 11:48 PM

https://github.com/t...comment-6503590
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users