欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

織夢(mèng)dedecms模板制作時(shí),循環(huán)遞增autoindex使用方法整理_DedeCms教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!
織夢(mèng)dedecms模板制作時(shí),循環(huán)遞增autoindex使用方法整理。僅供大家學(xué)習(xí)參考,希望對(duì)你有所幫助。
  1. {dede:arclist titlelen='26' row='10'
  2.   
  3. <li><a title="[field:title function='htmlspecialchars(@me)'/] " href="[field:arcurl /]">[field:title /]</a></li> 
  4.   
  5.  [field:global name=autoindex runphp="yes"]if(@me%5==0)@me="<br/>";else @me="";[/field:global] 
  6.   
  7. {/dede:arclist} 
紅色的即為autoindex標(biāo)簽用法。意思是,循環(huán)調(diào)用文章時(shí),到第五條時(shí)輸出<br/>,否則輸出空。這樣我們就實(shí)現(xiàn)了第五篇文章下面進(jìn)行換行。配合css和簡(jiǎn)單的php代碼使用,達(dá)到更多效果。
循環(huán)+1的寫法:
  1. [field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global] 
  2. 頻道頁使用時(shí)可以換成itemindex標(biāo)簽,原理同autoindex 
  3.   
  4. {dede:global name='itemindex'/} 
  5. {dede:global name='itemindex' runphp='yes'}if(@me%5==0)@me="<br/>";else @me="";{/dede:global} 
  6. {dede:global name='itemindex' runphp='yes'}@me=@me+1;{/dede:global} 
織夢(mèng)默認(rèn)的搜索頁不支持autoindex標(biāo)簽,需要修改核心文件增加支持:
  1. 找到文件:include/arc.searchview.class.php 
  2. 里面找到代碼:$this->dtp2->LoadSource($innertext); 
  3. 下面加上: 
  4. $GLOBALS['autoindex'] = 0; 
  5. ------------------------------------ 
  6. if($row = $this->dsql->GetArray("al")) 
  7. 下面加上: 
  8.  $GLOBALS['autoindex']++; 
  9.  $ids[$row['id']] = $row['id']; 
有需要的可以來記錄下來。


查看更多 DedeCms教程  織夢(mèng)模板  織夢(mèng)DedeCms視頻教程  織夢(mèng)dedecms專題

來源:模板無憂//所屬分類:DedeCms教程/更新時(shí)間:2020-05-16
相關(guān)DedeCms教程