国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

織夢CMS給文章列表加序號

2024-07-09 22:51:47
字體:
來源:轉載
供稿:網友

給文章列表加序號,效果圖如下:

第一:

織夢CMS給文章列表加序號 第1張

css代碼部分 

  1. <style type="text/css"> 
  2. <!-- 
  3. .downtop { 
  4. FLOAT: left; OVERFLOW: hidden; WIDTH: 218px; HEIGHT: 278px 
  5. .downtop UL.text { 
  6. MARGIN: 0px 10px; WIDTH: 198px; PADDING-TOP: 5px 
  7. .downtop UL.text LI { 
  8. WIDTH: 198px 
  9. .downtop UL.text SPAN { 
  10. DISPLAY: block; FLOAT: left 
  11. .downtop UL.text SPAN.num { 
  12. MARGIN-TOP: 4px; PADDING-LEFT: 1px; FONT-WEIGHT: bold; FONT-SIZE: 10px; WIDTH: 18px; LINE-HEIGHT: 12px; HEIGHT: 13px; TEXT-ALIGN: center;COLOR: #fff; BACKGROUND-COLOR: #b7b7b7 
  13. .downtop UL.text LI SPAN.active { 
  14. BACKGROUND-COLOR: #7abdff 
  15. .downtop UL.text SPAN.tit { 
  16. PADDING-LEFT: 10px; OVERFLOW: hidden; WIDTH: 168px; WHITE-SPACE: nowrap; HEIGHT: 21px 
  17. --> 
  18. </style> 
dede標簽部分代碼 
  1. <DIV class="downtop border"> 
  2. <UL class=text> 
  3. {dede:arclist orderby=pubdate type='commend.' titlelen='26' row='10' channel=3} 
  4. <LI>
  5. [field:global runphp='yes' name=autoindex] 
  6. $a="<SPAN>"; 
  7. $b="</SPAN>"; 
  8. $c="<SPAN>"; 
  9. if (@me > 3) @me = [email protected]$b; 
  10. else @me = [email protected]$b; 
  11. [/field:global] 
  12. <SPAN class=tit><A title="[field:title/]" 
  13. href="[field:filename/]">[field:title/]</A></SPAN></LI> 
  14. {/dede:arclist} 
  15. </UL> 
  16. </DIV> 

第二:

網站制作過程中經常會遇到在文章列表里面加數字序號的情況(如下圖)

                織夢CMS給文章列表加序號 第2張


可以通過織夢自帶的autoindex屬性來實現。

  1. {dede:arclist row='5' titlelen='30' }<li><em>[field:global.autoindex][/field:global]</em><ahref='[field:arcurl/]'title="[field:fulltitle/]">[field:title/]</a><cite>[field:pubdate function="MyDate('m-d',@me)"/]</cite></li>{/dede:arclist}

有時候使用{dede:channelartlist}標簽的時候用autoindex屬性是沒辦法實現的。需要用{dede:global name='itemindex'/}來代替。

第三:

dede文章列表加上序號效果

css代碼部分

  1. <style type="text/css">
  2. <!--
  3. .downtop {
  4. FLOAT: left; OVERFLOW: hidden; WIDTH: 218px; HEIGHT: 278px
  5. }
  6. .downtop UL.text {
  7. MARGIN: 0px 10px; WIDTH: 198px; PADDING-TOP: 5px
  8. }
  9. .downtop UL.text LI {
  10. WIDTH: 198px
  11. }
  12. .downtop UL.text SPAN {
  13. DISPLAY: block; FLOAT: left
  14. }
  15. .downtop UL.text SPAN.num {
  16. MARGIN-TOP: 4px; PADDING-LEFT: 1px; FONT-WEIGHT: bold; FONT-SIZE: 10px; WIDTH: 18px; LINE-HEIGHT: 12px; HEIGHT: 13px; TEXT-ALIGN: center;COLOR: #fff; BACKGROUND-COLOR: #b7b7b7
  17. }
  18. .downtop UL.text LI SPAN.active {
  19. BACKGROUND-COLOR: #7abdff
  20. }
  21. .downtop UL.text SPAN.tit {
  22. PADDING-LEFT: 10px; OVERFLOW: hidden; WIDTH: 168px; WHITE-SPACE: nowrap; HEIGHT: 21px
  23. }
  24. -->
  25. </style>

dede標簽部分代碼

  1. <DIV class="downtop border">
  2. <UL class=text>
  3. {dede:arclist orderby=pubdate type='commend.' titlelen='26' row='10' channel=3}
  4. <LI>[field:global runphp='yes' name=autoindex]
  5. $a="<SPAN class='num active'>";
  6. $b="</SPAN>";
  7. $c="<SPAN class='num'>";
  8. if (@me > 3) @me = [email protected]$b;
  9. else @me = [email protected]$b;
  10. [/field:global] <SPAN class=tit><A title="[field:title/]"
  11. href="[field:filename/]">[field:title/]</A></SPAN></LI>
  12. {/dede:arclist}
  13. </UL>
  14. </DIV>
效果圖:

織夢CMS給文章列表加序號 第3張

 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 方城县| 关岭| 裕民县| 定安县| 潮安县| 疏附县| 黄大仙区| 雷波县| 平乡县| 浑源县| 乌鲁木齐市| 晋城| 沙雅县| 永泰县| 连平县| 游戏| 颍上县| 泰兴市| 柳江县| 枣阳市| 宁夏| 阳春市| 古交市| 芜湖市| 花垣县| 新巴尔虎右旗| 桃园市| 宝坻区| 巴东县| 平和县| 湘潭市| 梨树县| 克什克腾旗| 清丰县| 内江市| 玉溪市| 信阳市| 始兴县| 福贡县| 嘉峪关市| 乌拉特中旗|