2013-04-13 72 views
0

我在我的Magento商店中有一些代碼,可以在2列表中動態顯示類別。如何將此表更改爲1列而不是2?我似乎無法找到更改列號的部分。更改表列號

<table width="100%" > 
<colgroup> 
<?php 
$wCol = (int)($gWidth/$colCount); 
$oneTdWidth = ($gWidth - $offset * ($colCount - 1))/$colCount; 
for ($i = 0; $i < $colCount; $i++) { ?> 
    <col width="<?php echo $oneTdWidth; ?>"> 
<?php } ?> 
</colgroup> 
<tbody> 
<?php 
$catIndex = 0; 
foreach ($map as $type => $items) { 
    foreach ($items as $row) { 
     ?><tr><?php 
     foreach ($row as $item) { 
      echo $this->renderArray($item, '<td rowspan="%rowspan%" colspan="%colspan%"">'); 
      switch ($item['type']) { 
       case 1: 
        if (isset($cats[$catIndex])) { 
         $text = 'Shop'; 
         $class = ''; 
         $nameCat = $cats[$catIndex]->getName(); 
         if (($colCount/$item['colspan']) >= 3) { 
          $text = '&nbsp;'; 
          $class = ' shop-btn-min'; 
          $nameCat = substr($cats[$catIndex]->getName(), 0, 35); 
          if (strlen($cats[$catIndex]->getName()) > 35) { 
           $nameCat .= '...'; 
          } 
         } 
         //$tdWidth = (int)($oneTdWidth * $item['colspan'] + $offset * ($item['colspan'] - 1)); 
         echo $this->renderBoutique(
          $cats[$catIndex], 
          '<div class="shop" style="background: url(%image_url%)> 
           <a href="%url%"> 
           <div class="brandholder"> 
            <div class="title"> 
             <h2>' . $nameCat . '</h2><span class="count-down hasCountdown">Ends in</span> 
             <span class="count-down"></span> 
             <span class="cntdown-source" style="display: none;">%privatesale_date_end_left%</span> 
            </div> 
            <div class="shop-btn'. $class . '">'.$text.'</div> 
           </div> 
           </a> 
          </div>'); 
         $catIndex++; 
        } 
        break; 
       case 2: 
        $banner = Mage::helper('privatesales/list')->getActiveBanner($item, $type); 
        if ($banner) { 
         //$tdWidth = (int)($oneTdWidth * $item['colspan'] + $offset * ($item['colspan'] - 1)); 
         echo $this->renderBanner(
          $banner, 
          '<div class="shop" style="background:url(%image_url%); height: %image_height%px;"><a href="%href%"></a></div>' 
         ); 
        } 
        break; 
      } 
      echo '</td>'; 
     } 
     ?></tr><?php 
    } 
} 
?> 
    <!-- FIXER --> 
    <tr class="picha" style="visibility: hidden;"> 
    <?php 
    for ($i = 0; $i < $colCount; $i++) { ?> 
     <td class="no-repeat shop"></td> 
    <?php } ?> 
    </tr>  
</tbody> 

回答