Ecshop How to globally invoke the specified article level two classification (note that the article classification is not a class two product classification)

Source: Internet
Author: User

1. Copy the following code directly to the template you want to display,修改所需文章分类id,其中 {if $cat.id eq 16}的意思是调用文章分类ID为16下的二级文章分类    

<? $GLOBALS[‘smarty‘]->assign(‘article_categories‘,   article_categories_tree(0)); //文章分类树 ?>

<!--{foreach from=$article_categories item=cat}-->      { if $cat.id eq  16 }                        <!--{foreach from=$cat.children item=child}-->             <li ><a href= "{$child.url}" >{$child.name| escape :html}</a></li>          <!--{/foreach}-->      {/ if } <!--{/foreach}-->2, call the specified article classification and classification of sub-categories <?  $GLOBALS [ ‘smarty‘ ]->assign( ‘article_categories‘ ,   article_categories_tree(0));  //文章分类  ?> <!--{ foreach from= $article_categories item=cat}-->       { if $cat .id eq 16}                     <a href= "{$cat.url}" style= "font-weight:bold;" >{ $cat .name|escape:html}</a>               <!--{ foreach from= $cat .children item=child}-->                   <li ><a href= "{$child.url}" >{ $child .name|escape:html}</a></li>               <!--{/ foreach }-->       {/ if } <!--{/ foreach }-->

Ecshop How to globally invoke the specified article level two classification (note that the article classification is not a class two product classification)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.