DedeCms autoindex和itemindex使用介绍
autoindex/itemindex 可以使用 @me+1;实现由指定数字开始,下面为大家详细介绍下具体的两者具体的用法,感兴趣的朋友可以参考下
代码如下:
让dedecms autoindex,itemindex 从0到1开始的办法
代码如下:
{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 从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实例
代码如下:
<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实例
代码如下:
<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 时用这种方式:
代码如下:
<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实例
代码如下:
<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
代码如下:
[field:global name='autoindex' runphp='yes']if(@me%10==0){@me="test";}else{@me='';}[/field:global]
{/dede:list}
对autoindex/itemindex使用自定义函数
先在include/extend.fun.php里添加自定义函数
代码如下:
$positionArr=array(275,330,380,435,495,547);
return $positionArr[$p];
然后在模板里添加
代码如下:
<!-----侧栏菜单------------------>
<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}
DedeCms autoindex和itemindex使用介绍的更多相关文章
- 让dedecms autoindex,itemindex 从0到1开始的办法! 多重样式输出(借鉴)
原网址:http://my.oschina.net/lyx2012/blog/55888 [field:global name=autoindex runphp="yes"]@me ...
- 利用dedecms autoindex让文章列表加上序列号
有些时候我们在制作模板的需要在文章标题前面加上序列号,可以通过织梦自带的autoindex属性来实现,实现方法很简单,只需要在序号递增的地方加上 这段代码就行,[field:global runphp ...
- dedecms {dede:php}标签用法介绍
最简单的输入如 代码如下 复制代码 {dede:php} $numA = 1; $numB = 2; echo $numA + $numB; {/dede:php} 从上面语句可以看出dede:php ...
- 织梦dedecms dede plus文件作用介绍及安全设置
一.安装设置 1.默认的后台模块中心有很多模块. 这里除了"友情链接"模块其他都可以删掉.在后台可以先卸载再删除. 2.如果是一开始就不想要的话,安装版plus目录下进行如下操作. ...
- DEDECMS自动编号(序号)autoindex属性
让织梦dedecms autoindex,itemindex 从0到1开始的办法! 1 2 3 [field:global name=autoindex runphp="yes"] ...
- DedeCMS中channelartlist自增参数global.itemindex
在 dede:channelartlist 标签下,使用: {dede:global.itemindex runphp='yes'} {/dede:global.itemindex} dede:cha ...
- DEDECMS自动编号(序号)autoindex属性(转)
版权声明:本文为博主原创文章,未经博主允许不得转载. 让织梦dedecms autoindex,itemindex 从0到1开始的办法! 1 2 3 [field:global name=autoin ...
- 织梦dedecms列表序号从0到1开始的办法 autoindex,itemindex标签
自增1 arclist 标签下使用 [field:global.autoindex/] 默认从1开始 channel 标签下使用 [field:global.au ...
- 织梦dedecms模板制作时,循环递增autoindex使用方法整理
文章转载:http://www.maihui123.com/dedecms/2012051964.html 织梦dedecms模板制作时,我们需要每循环一次,变量加一,这是就需要使用到autoinde ...
随机推荐
- 黑马程序员——利用swap函数研究C的指针
------Java培训.Android培训.iOS培训..Net培训.期待与您交流! ------- 设计3个函数,分别实现已下功能: 交换两个整数 交换两个整形指针 交换任意两个同类型的变量 #i ...
- Gunicorn快速入门
Gunicorn (独角兽)是一个高效的Python WSGI Server,通常用它来运行 wsgi application(由我们自己编写遵循WSGI application的编写规范) 或者 w ...
- Whitespace character
In computer science, whitespace is any character or series of whitespace characters that represent h ...
- "sessionFactory " or "hibernateTemplate " is required异常
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http:/ ...
- BZOJ 1011 遥远的行星
Description 直线上N颗行星,X=i处有行星i,行星J受到行星I的作用力,当且仅当i<=AJ.此时J受到作用力的大小为 Fi->j=Mi*Mj/(j-i) 其中A为很小的常量,故 ...
- ExtJS简单的动画效果(ext js淡入淡出特效)
1.html页面:Application HTML file - index.html <html> <head> <title>ExtJs fadeIn() an ...
- Maven的常用命令
转载:http://www.cnblogs.com/phoebus0501/archive/2011/05/10/2042511.html Maven库: http://repo2.maven.org ...
- 【HDOJ】5179 beautiful number
DFS. /* 5179 */ #include <iostream> #include <algorithm> #include <map> #include & ...
- UVA- 1504 - Genghis Khan the Conqueror(最小生成树-好题)
题意: n个点,m个边,然后给出m条边的顶点和权值,其次是q次替换,每次替换一条边,给出每次替换的边的顶点和权值,然后求出这次替换的最小生成树的值; 最后要你输出:q次替换的平均值.其中n<30 ...
- (转载)PHP常用函数
(转载)http://www.cnblogs.com/dreamhome/archive/2011/05/04/2037011.html <?php //==================== ...