VPS参考测评推荐
专注分享VPS主机优惠信息
衡天云优惠活动
华纳云最新优惠促销活动
jtti最新优惠促销活动

如何使用DedeCms自动索引和项目索引

locvps
主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情!
我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作

如何使用DedeCms自动索引和项目索引

如何使用dedecms autoindex和itemindex?

Autoindex/itemindex可以使用@ me+1;实现从指定的数字开始。下面就为大家详细介绍一下两者的具体用法。感兴趣的朋友可以参考一下。

推荐学习:梦想编织cms

代码如下:

& ltspan style = & quot最大宽度:90%&quot& gt& lt/span&gt。使dedecms自动索引的方法,itemindex从0到1开始。

代码如下:

【field:global name = auto index runphp = & quot;是的& quot】@ me = @ me+1;【/field:global】{ dede:global name = item index runphp = & quot;是的& quot} @ me = @ me+1;{/dede: global}使用autoindex itemindex的区别。

请使用{ dede:global name = &;#39;itemindex & amp#39;runphp = & amp#39;是的& amp#39;} @我;1之前{/dede:global}

默认情况下,在arclist标签下使用【field:global.autoindex/】从1开始,在channel标签下使用【field:global.autoindex/】从0开始,在channelartlist标签下使用{dede:global.itemindex/}。默认情况下,arclist从1开始,从0开始【field:global name = auto index run PHP =“yes & quot;】@ me = @ me-1;【/field:global】通道从1开始【field:global name = auto index run PHP =“yes & quot;】@ me = @ me+1;【/field:global】【field:typename/】Channel artlist从0开始{ dede:global name = item index run PHP = &;#39;是的& amp#39;} @ me = @ me-1;{/dede:global } & lt;div id = & quoth _ PD _ lm _ { dede:global . item index/} & quot;{ dede:global name = & amp;#39;itemindex & amp#39;runphp = & amp#39;是的& amp#39;} @ me =(@ me = = 1)?& amp#39;& amp#39;:& amp#39;style = & quot显示:无;"& amp#39;;{/dede:global } class = & quot;pd2 _ lmc _ l1 & quot& gtChannelartlist实例

代码如下:

{ dede:channel art list not typeid = & amp;#39;123、124、146、& amp#39;} & lta class = & quotpd2 _ LMT { dede:global name = item index runphp = & amp;#39;是的& amp#39;} @ me =(@ me = = 1)?& amp#39;1 & amp#39;:& amp#39;3 & amp#39;;{/dede:global } & quot;onmouseover = & quotshow item 2({ dede:global name = item index runphp = & amp;#39;是的& amp#39;} @ me = @ me-1;{/dede:global},& amp#39;pd _ lm & amp#39;,& amp#39;h _ pd _ lm _ & amp#39;,& amp#39;pd2 _ lmt & amp#39;);"href = & amp#39;{dede:字段名= & amp#39;typeurl & amp#39;/} & amp;#39;& gt{ dede:PHP } if($ ref obj-& gt;字段【& amp#39;ispart & amp#39;】){ echo $ ref obj-& gt;字段【& amp#39;键入名称和名称。#39;];} {/dede:PHP } & lt;/a & gt;{/dede:channelartlist}在标签下使用【field:global name=autoindex/】。

渠道实例

代码如下:

频道标题= & amp#39;32 & amp#39;} & lt李【field:global name = & amp;#39;自动索引& amp#39;runphp = & amp#39;是的& amp#39;】if(@ me % 2 = = 0){ @ me = & amp;#39;class = & quotrr & quot& amp#39;;} else { @ me = & amp#39;& amp#39;;}【/field:global】& gt;& lth3 & gt& lta href = & amp#39;【字段:type link/】& amp;#39;& gt【field:typename/】& lt;/a & gt;& lt/H3 & gt;& lt/Li & gt;{/dede:channel}在arclist中使用autoindex runphp时,请使用以下方法:

代码如下:

{ dede:arclist title len = & amp;#39;22 & amp#39;row = & amp#39;4 & amp#39;flag = & amp#39;c & amp#39;orderby = & amp#39;id & amp#39;} & lta href = & quot【字段:arcurl/】& quot;target = & quot_blank&quot& gt【field:title/】& lt;/a & gt;【field:global name = & amp;#39;自动索引& amp#39;runphp = & amp#39;是的& amp#39;】if(@ me = = 2){ @ me = & quot;";} else { @ me = & amp#39;& amp#39;;}【/field:global】{/dede:arc list }乘1。

【字段:global.autoindex/】arclist实例

代码如下:

{ dede:arclist channelid = 17 row = 6 order by = pubdate title len = 40 add fields = & amp;#39;docphoto、docjob、doctec & amp#39;typeid = & amp#39;123,136,146,155,172,182,202 & amp#39;} & ltdiv id = & quoth _ nrr _ ZJ _【field:global . auto index/】& quot;class = & quotnrr _ zjl & quot【field:global name = & amp;#39;自动索引& amp#39;runphp = & amp#39;是的& amp#39;】if(@ me = = 1){ @ me = & quot;";} else { @ me = & amp#39;style = & quot显示:无;"& amp#39;;}【/field:global】& gt;& ltdiv & gt& lta href = & quot【字段:arcurl/】& quot;title = & quot【field:full title/】& quot;target = & quot_blank&quot& gt& ltimg src = & quot【field:litpic/】& quot;alt = & quot【field:full title/】& quot;/& gt;& lt/a & gt;& lt/div & gt;& lt/div & gt;{/dede:arclist}如何自由定义起始号码?

Autoindex/itemindex可以使用@ me+1;实现从指定的数字开始。

遇到类似问题时请记下此笔记,使用时可以灵活发挥!

尝试列表选项卡下的自动索引。

代码如下:

{ dede:list page size = & amp;#39;40岁& amp#39;orderby = & amp#39;id & amp#39;}【field:global name = & amp;#39;自动索引& amp#39;runphp = & amp#39;是的& amp#39;】if(@ me % 10 = = 0){ @ me = & quot;测试& quot;} else { @ me = & amp#39;& amp#39;;}【/field:global】{/dede:list }为autoindex/itemindex使用自定义函数。

首先在include/extend.fun.php中添加一个自定义函数。

代码如下:

function my position($ p){ $ positionArr = array(275,330,380,435,495,547);返回$ positionArr【$ p】;然后将其添加到模板中。

代码如下:

{ dede:channel type = & amp;#39;儿子& amp#39;typeid = & amp#39;13 & amp#39;row = & amp#39;6 & amp#39;noself = & amp#39;是的& amp#39;} & lt!-边栏菜单-》& lt;div id = & amp#39;pdv _ 16795 & amp#39;class = & amp#39;pdv _ class & amp#39;title = & amp#39;& amp#39;style = & quot宽度:71px高度:20pxtop:【field:global . auto index函数= & amp#39;我的位置(@我)& amp#39;/】px;左:136pxz指数:17 & quot& gt& ltdiv style = & quot字体系列:SimSun颜色:# fecd2e字体大小:15px丰体重:大胆& quot& gt& lta style = & quot字体系列:SimSun颜色:# fecd2e字体大小:15px丰体重:大胆& quothref = & quot【field:type URL/】& quot;target=_blank&gt。& ltstrong & gt【field:typename/】& lt;/strong & gt;& lt/a & gt;& lt/div & gt;& lt/div & gt;{/dede:channel}

这几篇文章你可能也喜欢:

本文由主机参考刊发,转载请注明:如何使用DedeCms自动索引和项目索引 https://zhujicankao.com/110179.html

【腾讯云】领8888元采购礼包,抢爆款云服务器 每月 9元起,个人开发者加享折上折!
打赏
转载请注明原文链接:主机参考 » 如何使用DedeCms自动索引和项目索引
主机参考仅做资料收集,不对商家任何信息及交易做信用担保,购买前请注意风险,有交易纠纷请自行解决!请查阅:特别声明

评论 抢沙发

评论前必须登录!