ecshop 怎样在首页显示分类下的子分类
展开全部
<div id="categorys">
<div id="categorys" onMouseOver="showMc()" onMouseOut="hideMc()">
<div class="mt ld">
<h2><a href="catalog.php">全部商品分类<b></b></a></h2>
</div>
<div class="mc" >
<!--{foreach from=get_categories_tree(0) item=cat name=cat0}-->
<div class="item fore{$smarty.foreach.cat0.iteration}" onMouseOver="this.className='item fore{$smarty.foreach.cat0.iteration} hover'" onmouseout="this.className='item fore{$smarty.foreach.cat0.iteration}'" id="allser{$smarty.foreach.cat0.iteration}">
<span>
<h3 style="text-align:left;" id="allser{$smarty.foreach.cat0.iteration}"><a href="{$cat.url}" style="text-decoration:none">{$cat.name|escape:html}</a></h3>
<s></s></span>
<div class="i-mc" style="top:3px;">
<div class="close" onclick="$(this).parent().parent().removeClass('hover')"></div>
<div class="subitem">
<!--{foreach from=$cat.cat_id item=child name=cat_cat_id}-->
<dl class="fore{$smarty.foreach.cat_cat_id.iteration}">
<dt> <a href="{$child.url}" style="text-decoration:none">{$child.name|escape:html}</a> </dt>
<dd>
<!--{foreach from=$child.cat_id item=childer}-->
<em><a href="{$childer.url}" style="text-decoration:none">{$childer.name|escape:html}</a></em>
<!--{/foreach}-->
</dd>
</dl>
<!--{/foreach}-->
</div>
<div class="fr">
<?php
$cat_info = get_cat_info_ex($GLOBALS['smarty']->_var['cat']['id']);
$GLOBALS['smarty']->assign('index_image',get_advlist('导航菜单-'.$cat_info['cat_id'].'-右侧-促销专题', 5));
?>
<!-- {if $index_image} -->
<dl class="categorys-promotions">
<dt>促销活动</dt>
<dd>
<ul>
{foreach from=$index_image item=ad name=index_image}
<li><a target="_blank" href="{$ad.url}"><img src="{$ad.image}"></a></li>
{/foreach}
</ul>
</dd>
</dl>
<!-- {/if} -->
<dl class="categorys-brands">
<dt>推荐品牌</dt>
<dd>
<ul>
<!--{foreach from=get_brands1($GLOBALS['smarty']->_var['cat']['id']) item=bchilder}-->
<li style="float:left;width:97px;"><a target="_blank" href="{$bchilder.url}">{$bchilder.brand_name|escape:html}</a></li>
<!--{/foreach}-->
</ul>
</dd>
</dl>
</div>
</div>
</div>
<!--{/foreach}-->
<div class="extra"><a href="catalog.php">全部商品分类</a></div>
</div>
</div>
<div id="treasure"></div>
</div>
<div id="categorys" onMouseOver="showMc()" onMouseOut="hideMc()">
<div class="mt ld">
<h2><a href="catalog.php">全部商品分类<b></b></a></h2>
</div>
<div class="mc" >
<!--{foreach from=get_categories_tree(0) item=cat name=cat0}-->
<div class="item fore{$smarty.foreach.cat0.iteration}" onMouseOver="this.className='item fore{$smarty.foreach.cat0.iteration} hover'" onmouseout="this.className='item fore{$smarty.foreach.cat0.iteration}'" id="allser{$smarty.foreach.cat0.iteration}">
<span>
<h3 style="text-align:left;" id="allser{$smarty.foreach.cat0.iteration}"><a href="{$cat.url}" style="text-decoration:none">{$cat.name|escape:html}</a></h3>
<s></s></span>
<div class="i-mc" style="top:3px;">
<div class="close" onclick="$(this).parent().parent().removeClass('hover')"></div>
<div class="subitem">
<!--{foreach from=$cat.cat_id item=child name=cat_cat_id}-->
<dl class="fore{$smarty.foreach.cat_cat_id.iteration}">
<dt> <a href="{$child.url}" style="text-decoration:none">{$child.name|escape:html}</a> </dt>
<dd>
<!--{foreach from=$child.cat_id item=childer}-->
<em><a href="{$childer.url}" style="text-decoration:none">{$childer.name|escape:html}</a></em>
<!--{/foreach}-->
</dd>
</dl>
<!--{/foreach}-->
</div>
<div class="fr">
<?php
$cat_info = get_cat_info_ex($GLOBALS['smarty']->_var['cat']['id']);
$GLOBALS['smarty']->assign('index_image',get_advlist('导航菜单-'.$cat_info['cat_id'].'-右侧-促销专题', 5));
?>
<!-- {if $index_image} -->
<dl class="categorys-promotions">
<dt>促销活动</dt>
<dd>
<ul>
{foreach from=$index_image item=ad name=index_image}
<li><a target="_blank" href="{$ad.url}"><img src="{$ad.image}"></a></li>
{/foreach}
</ul>
</dd>
</dl>
<!-- {/if} -->
<dl class="categorys-brands">
<dt>推荐品牌</dt>
<dd>
<ul>
<!--{foreach from=get_brands1($GLOBALS['smarty']->_var['cat']['id']) item=bchilder}-->
<li style="float:left;width:97px;"><a target="_blank" href="{$bchilder.url}">{$bchilder.brand_name|escape:html}</a></li>
<!--{/foreach}-->
</ul>
</dd>
</dl>
</div>
</div>
</div>
<!--{/foreach}-->
<div class="extra"><a href="catalog.php">全部商品分类</a></div>
</div>
</div>
<div id="treasure"></div>
</div>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询