2016-04-09 8 views
0

に変更し、私たちはポートフォリオアーティストサイトを作成しています。ブートストラップクラス "span3"を使って4行にJoomlaのカテゴリリストを表示したいと考えています。Joomla 3.5 - "List All Categories"メニュー項目のスタイルを

カテゴリブログのように、com_content/views/categories/tmpl /ファイル用のテンプレートオーバーライドが必要な場合があります。

助けを歓迎します。

ルート==>テンプレート==> yourtemplatename ==> HTML ==> com_content ==>カテゴリ==> default_items.php

すべて削除し、以下のパスから ピーター

答えて

0

親切に開いているファイル以下のコード

<?php 
defined('_JEXEC') or die; 

JHtml::_('bootstrap.tooltip'); 

$class = ' class="span3"'; 
$lang = JFactory::getLanguage(); 

$cols = 3; 
$_cols = 0; 
$clear_class = '<div class="clearfix" style="clear:both;"></div>'; 

if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : 
?> 
    <?php foreach($this->items[$this->parent->id] as $id => $item) : ?> 
     <?php 
     if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : 
     if (!isset($this->items[$this->parent->id][$id + 1])) 
     { 
      //$class = ' class="span3 last"';   
     }  
     if($_cols >= $cols) { 
       echo $clear_class;    
      $_cols = 1; 
     } else { 
      ++$_cols; 
     }  
     ?> 
     <div <?php echo $class; ?> > 
     <?php $class; ?> 
      <h3 class="page-header item-title"> 
       <a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id, $item->language));?>"> 
       <?php echo $this->escape($item->title); ?></a> 
       <?php if ($this->params->get('show_cat_num_articles_cat') == 1) :?> 
        <span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::tooltipText('COM_CONTENT_NUM_ITEMS'); ?>"> 
         <?php echo $item->numitems; ?> 
        </span> 
       <?php endif; ?> 
       <?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?> 
        <a id="category-btn-<?php echo $item->id;?>" href="#category-<?php echo $item->id;?>" 
         data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span> </a> 
       <?php endif;?> 
      </h3> 
      <?php if ($this->params->get('show_description_image') && $item->getParams()->get('image')) : ?> 
       <img src="<?php echo $item->getParams()->get('image'); ?>" alt="<?php echo htmlspecialchars($item->getParams()->get('image_alt')); ?>" /> 
      <?php endif; ?> 
      <?php if ($this->params->get('show_subcat_desc_cat') == 1) :?> 
       <?php if ($item->description) : ?> 
        <div class="category-desc"> 
         <?php echo JHtml::_('content.prepare', $item->description, '', 'com_content.categories'); ?> 
        </div> 
       <?php endif; ?> 
      <?php endif; ?> 

      <?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) :?> 
       <div class="collapse fade" id="category-<?php echo $item->id;?>"> 
       <?php 
       $this->items[$item->id] = $item->getChildren(); 
       $this->parent = $item; 
       $this->maxLevelcat--; 
       echo $this->loadTemplate('items'); 
       $this->parent = $item->getParent(); 
       $this->maxLevelcat++; 
       ?> 
       </div> 
      <?php endif; ?> 
     </div> 
     <?php endif; ?> 
    <?php endforeach; ?> 
<?php endif; ?> 

enter image description here

+0

こんにちはヨーゼフ、 は非常にあなたに感謝をコードして貼り付けます迅速かつ有益な答えのために多くの。それはボックスの外で動作します!わずか2つの小さな問題があります。 .row-fluid [class * = "span"]:マージンを持つ最初の子:0. a行の後にこのクラスを取得することは可能ですか?フルと

? すべてのアイテムがレンダリングされたときには、niceがクリアされます。それはサイトの残りの部分を台無しにしません。 ありがとうピーター –

+0

あなたはcss 'div.categories-list.span3:first-child {margin:10px;}'を上書きすることができ、clearfixはクリアであることを意味します:どちらも削除できます –

+0

hi josef、私のための働く解決策。私は11行目のコードを>> $ clear_class = '

'から変更しました。 << to >> $ clear_class = '
'; <<。今私は各行の後にクラスの最初の子を持っています。 –

関連する問題