Ignore:
Timestamp:
2008/03/13 11:29:27 (16 years ago)
Author:
adachi
Message:

カテゴリブロックでリストタグを使うように修正 by pineray (merge r17070)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2/data/Smarty/templates/default/bloc/category.tpl

    r16583 r17146  
    2525</h2> 
    2626<div id="categoryarea"> 
     27  <ul id="categorytree"> 
     28  <!--{assign var=preLev value=1}--> 
     29  <!--{assign var=firstdone value=0}--> 
    2730  <!--{section name=cnt loop=$arrTree}--> 
    28  
    29       <!--{* 階層を level へ *}--> 
    30       <!--{assign var=level value="`$arrTree[cnt].level`}--> 
    31  
    32       <!--{* 最上位階層のリスト終了タグ *}--> 
    33       <!--{if $level == 1 && !$smarty.section.cnt.first}--> 
    34           </dl> 
     31    <!--{* 表示フラグがTRUEなら表示 *}--> 
     32    <!--{if $arrTree[cnt].display == 1}--> 
     33    <!--{assign var=level value=`$arrTree[cnt].level`}--> 
     34    <!--{assign var=levdiff value=`$level-$preLev`}--> 
     35      <!--{if $levdiff > 0}--> 
     36          <ul> 
     37      <!--{elseif $levdiff == 0 && $firstdone == 1}--> 
     38          </li> 
     39      <!--{elseif $levdiff < 0}--> 
     40        <!--{section name=d loop=`$levdiff*-1`}--> 
     41            </li> 
     42          </ul> 
     43        <!--{/section}--> 
     44        </li> 
    3545      <!--{/if}--> 
    36  
    37       <!--{* カテゴリ名を disp_name へ *}--> 
    38       <!--{assign var=disp_name value="`$arrTree[cnt].category_name`"}--> 
    39  
    40       <!--{* 表示カテゴリのみ *}--> 
    41       <!--{if $arrTree[cnt].display == 1}--> 
    42  
    43           <!--{* 選択したカテゴリ *}--> 
    44           <!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) || in_array($arrTree[cnt].category_id, $root_parent_id)}--> 
    45               <!--{if $level == 1}--> 
    46                   <dl><dt class="onmark"> 
    47               <!--{else}--> 
    48                   <dd> 
    49               <!--{/if}--> 
    50  
    51           <!--{* 未選択カテゴリ *}--> 
    52           <!--{else}--> 
    53               <!--{if $level == 1}--> 
    54                   <dl><dt> 
    55               <!--{else}--> 
    56                   <dd> 
    57               <!--{/if}--> 
    58           <!--{/if}--> 
    59  
    60           <!--{* 選択したカテゴリ *}--> 
    61           <!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) }--> 
    62               <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrTree[cnt].category_id}-->" class="onlink"><!--{$disp_name|sfCutString:20|escape}-->(<!--{$arrTree[cnt].product_count|default:0}-->)</a> 
    63  
    64           <!--{* 未選択カテゴリ *}--> 
    65           <!--{else}--> 
    66               <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrTree[cnt].category_id}-->"><!--{$disp_name|sfCutString:20|escape}-->(<!--{$arrTree[cnt].product_count|default:0}-->)</a> 
    67           <!--{/if}--> 
    68  
    69           <!--{if $level == 1}--> 
    70             </dt> 
    71           <!--{else}--> 
    72             </dd> 
    73           <!--{/if}--> 
    74  
     46    <li class="level<!--{$level}--><!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) }--> onmark<!--{/if}-->"><a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrTree[cnt].category_id}-->"<!--{if in_array($arrTree[cnt].category_id, $tpl_category_id) }--> class="onlink"<!--{/if}-->><!--{$arrTree[cnt].category_name|escape}-->(<!--{$arrTree[cnt].product_count|default:0}-->)</a> 
     47    <!--{if $firstdone == 0}--><!--{assign var=firstdone value=1}--><!--{/if}--> 
     48    <!--{assign var=preLev value=`$level`}--> 
     49    <!--{/if}--> 
     50    <!--{* セクションの最後に閉じタグを追加 *}--> 
     51    <!--{if $smarty.section.cnt.last}--> 
     52      <!--{if $preLev-1 > 0 }--> 
     53        <!--{section name=d loop=`$preLev-1`}--> 
     54          </li> 
     55        </ul> 
     56        <!--{/section}--> 
     57        </li> 
     58      <!--{else}--> 
     59        </li> 
    7560      <!--{/if}--> 
    76  
    77       <!--{* 最後に閉じるリスト終了タグ *}--> 
    78       <!--{if $smarty.section.cnt.last}--> 
    79         </dl> 
    80       <!--{/if}--> 
    81  
    82     <!--{/section}--> 
     61    <!--{/if}--> 
     62  <!--{/section}--> 
     63  </ul> 
    8364</div> 
    8465<!--商品カテゴリーここまで--> 
Note: See TracChangeset for help on using the changeset viewer.