原网址:http://my.oschina.net/lyx2012/blog/55888

[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}

自增1

arclist            标签下使用 [field:global.autoindex/] 默认从1开始
channel         标签下使用 [field:global.autoindex/] 默认从0开始
channelartlist 标签下使用 {dede:global.itemindex/}  默认从1开始

arclist  标签下使用[field:global name=autoindex runphp="yes"]@me=@me-1;[/field:global]  从0开始

channel  标签下使用 [field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global][field:typename/]  从1开始

channelartlist  标签下使用  {dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global}  从0开始

<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">

eg---->

{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}

{dede:channelartlist typeid="1" row="8" }
<div
class="combz01" {dede:global name=itemindex
runphp='yes'}if(@me==2)@me='id="with"';if(@me==5)@me='id="with"';if(@me==7)@me='id="with"';{/dede:global}>
<div class="combz01title"><a href="{dede:field
name='typeurl'/}" title="{dede:field name='typename'/}"
target="_blank"><b>{dede:field
name='typename'/}</b></a><u><a href="{dede:field
name='typeurl'/}" title="{dede:field name='typename'/}"
target="_blank">更多>></a></u></div>
<div class="comcon">
{dede:arclist titlelen='42' row='1' flag='c'}
<img src="[field:litpic/]" width="127" height="94"/>
<i>[field:description function="cn_substr(@me,100)"/]...<a
href="[field:arcurl /]" title="[field:fulltitle/]"
target="_blank">[详情]</a></i>
{/dede:arclist}
</div>
<div class="comconlist">
<ul>
 {dede:arclist titlelen="42" row="3"}
 <li><a href="[field:arcurl /]">[field:title /]</a></li>
 {/dede:arclist}
</ul>
</div>
</div>
{/dede:channelartlist}

在channel 标签下使用 [field:global name=autoindex/]  

eg---->

{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="<br />";}else{@me='
';}[/field:global]{/dede:arclist}

自增1

[field:global.autoindex/]

eg

{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}

{dede:channelartlist}多样式输出

{dede:global name='itemindex' runphp='yes'}@me=(@me!=1)?'':'class="hover"';{/dede:global} //第一个则定义为class=hover

{dede:global name='itemindex' runphp='yes'}@me=(@me==1)?'':'class="hover"';{/dede:global} //除了一个则定义为class=hover

让dedecms autoindex,itemindex 从0到1开始的办法! 多重样式输出(借鉴)的更多相关文章

  1. 织梦dedecms列表序号从0到1开始的办法 autoindex,itemindex标签

    自增1 arclist            标签下使用 [field:global.autoindex/] 默认从1开始 channel         标签下使用 [field:global.au ...

  2. DedeCms autoindex和itemindex使用介绍

    autoindex/itemindex 可以使用 @me+1;实现由指定数字开始,下面为大家详细介绍下具体的两者具体的用法,感兴趣的朋友可以参考下 代码如下: <span style=" ...

  3. 未在本地计算机上注册“Microsoft.Jet.OleDb.4.0”提供程序。解决办法

    在64位服务器系统上,默认不支持Microsoft.Jet.OLEDB.4.0的驱动程序,系统默认会提示未在本地计算机上注册"Microsoft.Jet.OLEDB.4.0"的错误 ...

  4. Win7系统安装好Axure点击运行报.NET Framework4.0未安装的解决办法

      1:问题 由于工作需要,需要研究一下Axure原型设计软件的使用方式,在公司的电脑上成功安装了从同事那里拿来的Axure7.0软件,能够正确运行没有任何问题,在自己的电脑上安装的也非常顺利,不过运 ...

  5. FontAwesome 4.7.0 中完整的675个图标样式CSS参考

    FontAwesome 4.7.0 中完整的675个图标样式CSS参考 用法:首先引入CSS文件:<link href="https://maxcdn.bootstrapcdn.com ...

  6. 调用类java.lang.Math的成员方法"public static double random"运算下面表达式10000次,统计其中生成的整数0,1,2,.....20的个数分别是多少,并输出统计结果.(int)(Math.random()*20+0.5)

    public class Test2 { public static void main(String args[]){ int num; int count[]=new int[21]; for(i ...

  7. 让VC6.0编译出来的程序支持XP样式或XP风格

    (1)VC6.0编译出来的win32程序不支持winxp样式的原因:微软WINXP系统更新了Comctl32.dll(ver 6.0)这个“XP风格”的控件.为了保留传统的Windows界面风格,特地 ...

  8. dedecms如何修改共0页/0条记录为英文版?

    近日,在测试一个网站功能的时候,发现在搜索结果的下面为中文的“共0页/0条记录”,但客户的网站为英文版,所以我们需要将搜索的结果信息也要显示为英文,好了,我们开始动手修改dedecms的文件,以达到我 ...

  9. 利用dedecms autoindex让文章列表加上序列号

    有些时候我们在制作模板的需要在文章标题前面加上序列号,可以通过织梦自带的autoindex属性来实现,实现方法很简单,只需要在序号递增的地方加上 这段代码就行,[field:global runphp ...

随机推荐

  1. 1627. Join

    http://acm.timus.ru/problem.aspx?space=1&num=1627 给一个无向图,问可以有多少生成树 参照     周冬<生成树的计数及其应用> 代 ...

  2. WireShark网络性能分析

    最近生产上出现一个性能问题,表现为:行情延时5s左右.从log一路追查下去,发现是我们自己写的一个行情网关(部署在xx.xx.xx.132)<->第三方的中转网关(部署在xx.xx.xx. ...

  3. web app性能大讨论

    1.Application:应用,为用户完成一个或多个功能而设计的程序: 2.Internet or Intranet:运行于广域网或局域网之上: 3.Browser-supported langua ...

  4. Can't update: no tracked branch

    git更新错误:Can't update: no tracked branch No tracked branch configured for branch master. To make your ...

  5. 开发中的一些解决方案(c#)

    1.如果需要配置文件,不妨考虑用XML序列化技术实现XML配置文件.在C#中引入System.Xml.Serialization命名空间,编写实体类序列化到XML文件中(或反序列化到对象),编写少量代 ...

  6. Whole life

    Whole life the wonder such you bring the beautyI can see but i keep deep inside on itOh life i feel ...

  7. JS Math.max() 函数

    Math.max(a,b,...,x,y) -- 返回数个数字中较大的值 max是maximum的缩写,中文"最大量"的意思 max函数语法Math.max(a,b,...,x,y ...

  8. tomcat启动不了

    今天弄了一个项目想在在自己的电脑上面运行起来,当部署在tomcat上的时候发现tomcat就是启动不来,思忖了一段时间后发现原来是tomcat的相关jar没有导入进去.所以,properties-&g ...

  9. 转:js中this、call、apply的用法

    (一)关于this首先关于this我想说一句话,这句话记住了this的用法你也就差不多都能明白了:this指的是当前函数的对象.这句话可能比较绕,我会举出很多例子和这句话呼应的!(看下文)1.首先看下 ...

  10. mysql 同一IP 产生太多终端的数据库连接导致阻塞

    问题:null, message from server: "Host 'ip' is blocked because of many connection errors; unblock ...