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

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

[field:global name=autoindex runphp="yes"]@[email protected]+1;[/field:global]

{dede:global name=itemindex runphp="yes"}@[email protected]+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"]@[email protected];[/field:global]

channel  从1开始 [field:global name=autoindex runphp="yes"]@[email protected]+1;[/field:global][field:typename/]

channelartlist  从0开始 {dede:global name=itemindex runphp=‘yes‘}@[email protected];{/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">

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‘}@[email protected];{/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}

时间: 2024-08-25 02:49:21

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

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

自增1 arclist            标签下使用 [field:global.autoindex/] 默认从1开始 channel         标签下使用 [field:global.autoindex/] 默认从0开 channelartlist 标签下使用 {dede:global.itemindex/}  默认从1开始 1 arclist 从0开始 [field:global name=autoindex runphp="yes"]@[email protected]

DedeCms autoindex和itemindex使用介绍

autoindex/itemindex 可以使用 @me+1;实现由指定数字开始,下面为大家详细介绍下具体的两者具体的用法,感兴趣的朋友可以参考下 代码如下: <span style="color: rgb(51, 51, 51); font-family: 宋体, arial, helvetica, sans-serif; font-size: 14px; line-height: 26px; "></span> 让dedecms autoindex,item

android在view.requestFocus(0)返回false的解决办法

我们有时候想让listview的第一行自动获取到焦点,我们就会使用view.requestFocus(0)来操作,而有时候并不生效,debug后显示rerurn为false. 这是因为我们获取焦点太早,listview控件还为加载完毕.可以尝试一下方法解决: listview.post(new Runnable(){ @Override public void run(){ view.requestFocus(0); } }); ok,问题解决! android在view.requestFocu

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

在64位服务器系统上,默认不支持Microsoft.Jet.OLEDB.4.0的驱动程序,系统默认会提示未在本地计算机上注册"Microsoft.Jet.OLEDB.4.0"的错误. 解决办法:下载数据库引擎:AccessDatabaseEngine_X64 安装即可

Java AOP nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice || Error creating bean with name &#39;org.springframework.aop.aspectj.AspectJPointcutAdvisor#0&#39; 两个异常解决办法

贴出applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://ww

面试题3:在一个长度为n的数组里的所有数字都在0到n-1的范围内。 数组中某些数字是重复的,但不知道有几个数字是重复的。也不知道每个数字重复几次。请找出数组中任意一个重复的数字。 例如,如果输入长度为7的数组{2,3,1,0,2,5,3},那么对应的输出是第一个重复的数字2。

package siweifasan_6_5; /** * @Description:在一个长度为n的数组里的所有数字都在0到n-1的范围内. * 数组中某些数字是重复的,但不知道有几个数字是重复的.也不知道每个数字重复几次. * 请找出数组中任意一个重复的数字. * 例如,如果输入长度为7的数组{2,3,1,0,2,5,3},那么对应的输出是第一个重复的数字2. * @Parameters: // Parameters: // numbers: an array of integers //

【C++】4.输入一个0~6的整数,转换成星期输出

// // main.cpp // 2_4 // // Created by T.P on 2018/3/4. // Copyright ? 2018年 T.P. All rights reserved. // //输入一个0~6的整数,转换成星期输出 #include <iostream> #include <iomanip> using namespace std; int main(int argc, const char * argv[]) { // insert code

剑指offer(Java版)第一题:在一个长度为n的数组里的所有数字都在0到n-1的范围内。 数组中某些数字是重复的,但不知道有几个数字重复了,也不知道每个数字重复了几次。 *请找出数组中任意一个重复的数字。 *例如,如果输入长度为7的数组{2, 3, 1, 0, 2, 5, 3},那么对应的输出是重复的数字2或者3。

/*在一个长度为n的数组里的所有数字都在0到n-1的范围内. * 数组中某些数字是重复的,但不知道有几个数字重复了,也不知道每个数字重复了几次. * 请找出数组中任意一个重复的数字. * 例如,如果输入长度为7的数组{2, 3, 1, 0, 2, 5, 3},那么对应的输出是重复的数字2或者3.*/ import java.util.*; public class Class1 { static class findRepeatedNumber{ public int findRepeatedN

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

近日,在测试一个网站功能的时候,发现在搜索结果的下面为中文的“共0页/0条记录”,但客户的网站为英文版,所以我们需要将搜索的结果信息也要显示为英文,好了,我们开始动手修改dedecms的文件,以达到我们需要的效果吧! “共0页/0条记录”我们需要修改include/datalistcp.class.php文件,但是请注意修改了这个文件之后其它很多地方的分页内容都将是显示英文的. 找到文件大概在第30行: $lang_pre_page = '上页';    $lang_next_page = '下