让织梦dedecms autoindex,itemindex 从0到1开始的办法!

1
2
3
[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 标签下使用

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<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/]

1
2
3
4
5
6
7
8
9
10
11
12
13
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/]

1
2
3
4
5
6
7
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}

原文链接: http://blog.csdn.net/a1079540945/article/details/38678155

DEDECMS自动编号(序号)autoindex属性的更多相关文章

  1. DEDECMS自动编号(序号)autoindex属性(转)

    版权声明:本文为博主原创文章,未经博主允许不得转载. 让织梦dedecms autoindex,itemindex 从0到1开始的办法! 1 2 3 [field:global name=autoin ...

  2. DEDE自增序号 自动增加数字序号 autoindex属性

    在DEDE的模板制作过程中经常会需要用到1,2,3,4....这样的排序方式,这个时候就需要用到DEDE自带的自增序号产生函数 1.按顺序从1开始 需要使用到 [field:global runphp ...

  3. SQL Server 重新恢复自动编号列的序号

    1. truncate table tablename2. DBCC CHECKIDENT (tablename,reseed,1)   truncate命令不但会清除所有的数据,还会将IDENTIT ...

  4. Microsoft Office Word 中的公式自动编号

    先插入公式,#,插入题注(交叉引用),生成了标号.此时整个公式是题注样式.在公式和标号之间插入一个样式分隔符. ____________________________________________ ...

  5. 页面定制CSS代码初探(六):h2、h3 标题自动生成序号 详细探索过程

    前言 最近在整理博客写作格式的规范,碰到一个问题:标题要不要加序号? 直到我碰到一个人这么说 手动维护编号实在是一件很闹心的事情, 如果位置靠前的某个段落被删除了, 那么几乎每个段落的编号都要手动修改 ...

  6. GridView控件中加自动排列序号

    GridView控件中加自动排列序号 为 Gridview 增加一个新的空白列,如下: <asp:BoundField  HeaderText="序号">    < ...

  7. Word2013对公式处理:样式、自动编号、交叉引用

    因快写毕业论文,专门研究了一下Word2013对公式的处理,有一点小心得,记在这里. 文章中公式展示的预期效果是:公式居中,尾端有编号,同时在文章中可以实现引用.实现该效果有很多方法,这里就说一种,其 ...

  8. 自动编号维护SNRO

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  9. SQL2005中设置自动编号字段【转】

    如果希望重新定义在表中添加新记录时该列中自动生成并存储于列中的序列号,则可以更改该列的标识属性.在每个表中只能设置一个列的标识属性. 具有标识属性的列包含系统生成的连续值,该值唯一地标识表中的每一行( ...

随机推荐

  1. java 编译中没有清除之前编译出来的文件。

    最近在写一个类时候使用了内部类,然后又将这个类改用普通类来实现.但在运行时访问局部变量时候出现了NullPointException异常,想来想去没有想明白,后来清除了一个之前编译出来的文件*.cla ...

  2. OAuth2.0_豆瓣登录_API错误返回码说明一览表[转]

    转自: http://blog.unvs.cn/archives/douban-oauth-2.0-error_code.html 在遵循OAuth2.0协议,开始制作豆瓣过程中,经常会遇到以下两个错 ...

  3. 安装ipython import path error

    sudo pip install ipython --upgrade # 升级 版本兼容性问题,升级到最新版本的ipython 后,会报错 from pickleshare import Pickle ...

  4. git重写历史记录

    1 修改上一次历史提交,替换掉上次的提交git commit --amend 2 git rebase 将不同分支路径合并到同一分支路径上eg:将master分支上的 conflic rebase合并 ...

  5. 把Nginx加为系统服务(service nginx start/stop/restart)

    1.编写脚本,名为nginx #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - ...

  6. orientationchange不管用啊

    首先引入JQuery Mobile包,将 <script> //手持设备方向改变时执行 $(window).bind( 'orientationchange', function(e){ ...

  7. 向sqlserver插入二进制数据(比如图片)

    sqlserver插入二进制数据 偶然在sqlteam看到了,真是够绝,这都想得出来,很便捷的一个方式(只适用于SQL SERVER 2005+),代码如下: CREATE TABLE myTable ...

  8. python实现线程池

    线程池 简单线程池 import queue import threading import time class ThreadPool(object): #创建线程池类 def __init__(s ...

  9. C Primer Plus(第五版)3

    第三章 数据和 C 在本章中你将学习下列内容: 1. 关键字: int, short, long, unsigned, char, float, double, _Bool, _Complex, _I ...

  10. Ext中 get、getDom、getCmp的区别

    getDom方法能够得到文档中的DOM节点,该方法中包含一个参数,该参数可以是DOM节点的id.DOM节点对象或DOM节点对应的Ext元素(Element)等. (与getElementById是一个 ...