{php $CATEGORY = cache_read('category-'.$mid.'.php');} {php $child = get_maincat(0, $mid, 1);}

原材料
  {loop $child $i $c} {if in_array($c[catid], array(4,5,13,15,17,21,22,23,24,27))}

  {set_style($c[catname], $c[style])} {if $c[child]}{php $sub = get_maincat($c[catid], $CATEGORY, 1);} {loop $sub $j $s}{if $j < 5} {set_style($s[catname], $s[style])}{/if}{/loop} {/if} {/if}{/loop}

工业品
  {loop $child $i $c} {if in_array($c[catid], array(6,7,14,16,19,20,26,28,31,32))}

  {set_style($c[catname], $c[style])} {if $c[child]}{php $sub = get_maincat($c[catid], $CATEGORY, 1);} {loop $sub $j $s}{if $j < 5} {set_style($s[catname], $s[style])}{/if}{/loop} {/if} {/if}{/loop}

家居百货
  {loop $child $i $c} {if in_array($c[catid], array(8,9,10,18,25,29,30,33,34,35))}

  {set_style($c[catname], $c[style])} {if $c[child]}{php $sub = get_maincat($c[catid], $CATEGORY, 1);} {loop $sub $j $s}{if $j < 5} {set_style($s[catname], $s[style])}{/if}{/loop} {/if} {/if}{/loop}

服务加工
  {loop $child $i $c} {if in_array($c[catid], array(11,12,36,37,38,39,40,41,42,43))}

  {set_style($c[catname], $c[style])} {if $c[child]}{php $sub = get_maincat($c[catid], $CATEGORY, 1);} {loop $sub $j $s}{if $j < 5} {set_style($s[catname], $s[style])}{/if}{/loop} {/if} {/if}{/loop}