搜索

首页  >  问答  >  正文

求教各位老师,如何将“全部商品分类”显示为图文展示!

<div class="site-header" style="clear:both;">
 <div class="container">
     <div class="header-logo">
         <a href="library/index.php" title="{$shop_name}"><img src="images/logo.gif" /></a>
        </div>
        <div class="header-nav">
         <ul class="nav-list">
             <li class="nav-category">
                 <a class="btn-category-list" href="library/catalog.php" {if $script_name eq 'index'}style="display:none;"{/if}>全部商品分类</a>
                 <div class="site-category {if $script_name neq 'index'}category-hidden{/if}">
                     <ul class="site-category-list clearfix" id="site-category-list">
                            <!--{foreach from=$categories item=cat name=foo}-->
                         <li class="category-item">
                             <a class="title" href="{$cat.url}">{$cat.name|escape:html}<i class="iconfont"></i></a>
                                <div class="children clearfix">
                                 <!--{foreach from=$cat.cat_id item=child name=no1}-->
                                    <!--{if $smarty.foreach.no1.iteration %6 ==1}-->
                                 <ul class="children-list">
                                    <!--{/if}-->
                                     <li>
                                         <a href="{$child.url}" class="link">
                                             <img class="thumb" src="data/catthumb/{$child.thumb}" width="40" height="40">
                                             <span>{$child.name|escape:html}</span>
                                            </a>
                                        </li>
                                    <!--{if $smarty.foreach.no1.iteration % 6 == 0 || $smarty.foreach.no1.last}-->
                                    </ul>
                                    <!--{/if}-->
                                    <!--{/foreach}-->
                                </div>
                            </li>
                            <!--{/foreach}-->
                        </ul>
                    </div>
                </li>
                <!-- {foreach name=nav_middle_list from=$navigator_list.middle item=nav} -->
             <li class="nav-item">
                 <a class="link" href="{$nav.url}" {if $nav.opennew eq 1}target="_blank"{/if} {if $nav.active eq 1} class="current"{/if}><span>{$nav.name}</span></a>
                    <!-- {if $nav.cat_list}-->
                    <div class='item-children'>
                     <div class="container">
                         <ul class="children-list clearfix">
                             <!--{foreach from=$nav.goods item=cat name=cat}-->
                                    <!-- {if $smarty.foreach.cat.iteration<7}-->
                                    <!--{foreach from=$cat.goods item=good name=good}-->
                                    <!-- {if $smarty.foreach.good.iteration==1}-->
                                    <li class="first">
                                        <div class="figure figure-thumb"><a href="{$good.url}"><img src="{$good.thumb|escape:html}"  alt="{$good.name|escape:html}"></a></div>
                                        <div class="title"><a href="{$good.url}">{$good.name|escape:html}</a></div>
                                        <p class="price">{$good.shop_price}元</p>
                                    </li>
                                    <!-- {/if} -->
                                    <!--{/foreach}-->
                                    <!-- {/if} -->
                                <!--{/foreach}-->
                            </ul>
                     </div>
                    </div>
                    <!-- {/if}-->
                </li>
                <!-- {/foreach} -->
            </ul>
        </div>
        <div class="header-search">
         <form action="library/search.php" method="get" id="searchForm" name="searchForm" onSubmit="return checkSearchForm()" class="search-form clearfix">
             <label class="hide">站内搜索</label>
          <input class="search-text" type="text" name="keywords" id="keyword" value="{$search_keywords|escape}" autocomplete="off">
          <input type="hidden" value="k1" name="dataBi">
          <button type="submit" class="search-btn iconfont"></button>
                {if $searchkeywords}
                <div class="hot-words" {if $search_keywords}style="display:none"{/if}>
                 {foreach from=$searchkeywords item=val} <a href="search.php?keywords={$val|escape:url}" target="_blank">{$val}</a> {/foreach}
                </div>
                {/if}
        </form>
        </div>
    </div>
 <div id="J_navMenu" class="header-nav-menu" style="display: none;">
     <div class="container"></div>
    </div>
</div>


#
DreamDream2367 天前1152

全部回复(2)我来回复

  • 亚连

    亚连2018-06-06 13:57:13

    图文展示?你是说把所有商品分类显示出来吧

    回复
    0
  • Dream

    现在所有商品分类都是以文字显示的,但我把商品分类都添加了图片,我想它以图片的方式显示出所有商品分类。 就像这个商品分类一样显示出来https://list.mi.com/

    Dream · 2018-06-07 09:04:22
  • 取消回复