国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

織夢dedecms自增數使用方法

2024-07-12 09:12:40
字體:
來源:轉載
供稿:網友
織夢dedecms自增數使用方法 。
[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global]
{dede:global name=itemindex runphp="yes"}@me=@me+1;{/dede:global}
autoindex itemindex 的使用心得區別
channelartlist 標簽下使用 {dede:global name='itemindex' runphp='yes'}@me;{/dede:global}
自增數
arclist 標簽下使用 [field:global.autoindex/] 默認從1開始
channel 標簽下使用 [field:global.autoindex/] 默認從0開始
channelartlist 標簽下使用 {dede:global.itemindex/} 默認從1開始
自定義 :[field:global name=autoindex runphp="yes"]@me=@me+4;[/field:global]  從5開始
arclist 從0開始[field:global name=autoindex runphp="yes"]@me=@me-1;[/field:global]
channel 從1開始[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global][field:typename/]
channelartlist 從0開始{dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global}
<div id="h_pd_lm_{dede:global.itemindex/}" {dede:global name='itemindex' runphp='yes'}@me=(@me==1)?'':'style="display:none;"';{/dede:global} class="pd2_lmc_l1">
channelartlist實例
復制代碼代碼如下:
{dede:channelartlist notypeid='123,124,146,147'}
<a class="pd2_lmt{dede:global name=itemindex runphp='yes'}@me=(@me==1)?'1':'3';{/dede:global}"onmouseover="showitem2({dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global},'pd_lm','h_pd_lm_','pd2_lmt');" href='{dede:field name='typeurl'/}'>
{dede:php}if($refObj->Fields['ispart']){echo $refObj->Fields['typename'];}{/dede:php}
</a>
{/dede:channelartlist}
標簽下使用 [field:global name=autoindex/]
channel實例
復制代碼代碼如下:
{dede:channel titlelen='32'}
<li [field:global name='autoindex'runphp='yes']if(@me%2==0){@me='class="rr"';}else{@me='';}[/field:global] ><h3><a href='[field:typelink/]'>[field:typename/]</a></h3></li>
{/dede:channel}
在arclist中使用autoindex runphp 時用這種方式:
復制代碼代碼如下:
{dede:arclist titlelen='22' row='4' flag='c' orderby='id'}
<a href="[field:arcurl /]" target="_blank">[field:title /]</a>
[field:global name='autoindex' runphp='yes']if(@me==2){@me="
";}else{@me=' ';}[/field:global]{/dede:arclist}
自增1
[field:global.autoindex/]
arclist實例
復制代碼代碼如下:
{dede:arclist channelid=17 row=6 orderby=pubdate titlelen=40 addfields='docphoto,docjob,doctec'typeid='123,136,146,155,172,182,202'}
<div id="h_nrr_zj_[field:global.autoindex/]"class="nrr_zjl" [field:global name='autoindex'runphp='yes']if(@me==1){@me="";}else{@me='style="display:none;"';}[/field:global] >
<div><a href="[field:arcurl/]" title="[field:fulltitle/]" target="_blank"><img src="[field:litpic/]"alt="[field:fulltitle/]" /></a></div>
</div>
{/dede:arclist}
如何自由定義 開始的數字
autoindex/itemindex 可以使用 @me+1;實現由指定數字開始
遇到類似的問題做下這個筆記,在用到的時候可以靈活發揮!
list 標簽下試用autoindex
復制代碼代碼如下:
{dede:list pagesize='40' orderby='id'}
[field:global name='autoindex' runphp='yes']if(@me%10==0){@me="test";}else{@me='';}[/field:global]
{/dede:list}
對autoindex/itemindex使用自定義函數
先在include/extend.fun.php里添加自定義函數
復制代碼代碼如下:
function MyPosition($p){
$positionArr=array(275,330,380,435,495,547);
return $positionArr[$p];
復制代碼代碼如下:
{dede:channel type='son' typeid='13' row='6' noself='yes'}
<!-----側欄菜單------------------>
<div id='pdv_16795' class='pdv_class' title='' style="width:71px;height:20px;top:[field:global.autoindex function='MyPosition(@me)'/]px;left:136px; z-index:17">
<div style="FONT-FAMILY: SimSun; COLOR: #fecd2e; FONT-SIZE: 15px; fon-weight: bold"><a style="FONT-FAMILY: SimSun; COLOR: #fecd2e; FONT-SIZE: 15px; fon-weight: bold" href="[field:typeurl/]" target=_blank><strong>[field:typename/]</strong></a></div>
</div>
{/dede:channel}

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 高台县| 沙河市| 新闻| 泾源县| 治县。| 阿荣旗| 景宁| 贡山| 育儿| 达拉特旗| 丘北县| 安阳市| 应城市| 沿河| 花莲县| 沁源县| 娄烦县| 漳平市| 故城县| 门源| 昌都县| 渝中区| 灵川县| 鄂伦春自治旗| 汉川市| 石屏县| 疏勒县| 宿迁市| 邹平县| 广东省| 温泉县| 平安县| 长乐市| 麻城市| 双辽市| 新和县| 肇东市| 渝北区| 尼木县| 喀喇沁旗| 泸水县|