----------------
ECCUBE 2.12.2
PHP 5.3.3
MySQL 5.1.66
----------------
大変恐縮ですが、お力添えをいただけると幸いです。
カテゴリをアコーディオン式にしたいと思い、
http://xoops.ec-cube.net/modules/newbb/viewtopic.php?topic_id=12852&forum=10や、
http://xoops.ec-cube.net/modules/newbb/viewtopic.php?viewmode=flat&topic_id=14524&forum=10、
http://ec-cube.nakweb.com/blog/1618.html等を参考にカスタマイズを行ったのですが、
全カテゴリが一覧で表示されてしまい、アコーディオン形式になりません。
ddaccordion.js
が正常に反映されていないようなのですが、
どのように改善を行えばよいでしょうか。
お忙しい中恐縮ですが、何卒よろしくお願いいたします。
data/Smartry/templates/default/frontparts/block/category.tpl
<script type="text/javascript">
<!--
ddaccordion.init({
headerclass: "expandable",
contentclass: "categoryitems",
revealtype: "click",
mouseoverdelay: 200,
collapseprev: false,
defaultexpanded: [],
onemustopen: false,
animatedefault: false,
persiststate: true,
toggleclass: ["", ""],
animatespeed: "slow",
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})
//-->
</script>
<div class="block_outer">
<div id="category_area">
<div class="block_body">
<h2><img src="<!--{$TPL_URLPATH}-->img/title/tit_bloc_category.jpg" alt="商品カテゴリ" /></h2>
<div id="accordion_menu">
<!--{include file='frontparts/bloc/category_tree_fork_accordion.tpl' children=$arrTree}-->
</div>
</div>
</div>
</div>
data/Smartry/templates/default/frontparts/bloc/category_tree_fork_accordion.tpl
<!--{strip}-->
<!--{foreach from=$children item=child}-->
<!--{if $child.level == 1}-->
<!--{* 1階層 *}-->
<div class="ac_top">
<!--{else}-->
<!--{* 2階層以降 *}-->
<li>
<!--{/if}-->
<!--{if isset($child.children|smarty:nodefaults)}-->
<!--{* 子持ちの階層 *}-->
<div class='expandable'><span class='accordprefix'></span></div>
<p class='ex_title'><a href='<!--{$smarty.const.ROOT_URLPATH}-->products/list.php?category_id=<!--{$child.category_id}-->'<!--{if in_array($child.category_id, $tpl_category_id)}--> class='onlink'<!--{/if}-->><!--{$child.category_name|h}-->(<!--{$child.product_count|default:0}-->)</a></p>
<div class='categoryitems'>
<ul>
<!--{include file='frontparts/bloc/category_tree_fork_accordion.tpl' children=$child.children}-->
</ul>
</div>
<!--{else}-->
<!--{* 子持ちでない階層 *}-->
<a href='<!--{$smarty.const.ROOT_URLPATH}-->products/list.php?category_id=<!--{$child.category_id}-->'<!--{if in_array($child.category_id, $tpl_category_id)}--> class='onlink'<!--{/if}-->><!--{$child.category_name|h}-->(<!--{$child.product_count|default:0}-->)</a>
<!--{/if}-->
<!--{if $child.level == 1}-->
<!--{* 1階層 *}-->
</div>
<!--{else}-->
<!--{* 2階層以降 *}-->
</li>
<!--{/if}-->
<!--{/foreach}-->
<!--{/strip}-->