destoon implements the method of calling the classification to which it belongs before the information

  • 2021-07-09 07:25:21
  • OfStack

Sometimes we need to add the classification he belongs to in front of some information, so that he can be displayed. Although some of the methods introduced in this paper are not universal, they can achieve this effect. The code is as follows for your reference:


<!--{php $tags=tag("moduleid=21&condition=status=3 and catid IN(263,264,249,327,11,598,599,12,238,237,265,285,328,567,570) and level=6&showcat=1&areaid=$cityid&pagesize=11&length=38&datetype=2&target=_blank&order=addtime desc&template=null")}-->
 
 {loop $tags $i $t}         
  <li>
  <span>[{$t[catname]}]</span><a href="{$t[linkurl]}" rel="external nofollow" {if $target} target="{$target}"{/if} title="{$t[alt]}">{$t[title]}</a> 
  </li>
      {/if}
  {/loop}

Note:

1. The sentence catid IN (263, 264, 249, 327, 11, 598, 599, 12, 238, 237, 265, 285, 328, 567, 570) in the code is the classification to which all information information belongs
(The scope of this id is relatively fixed and does not have universality. You need to fill in your own information and classify id below)

2. Write showcat=1

3. {$t [catname]} This is the category name


Related articles: