校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 網(wǎng)站建設(shè) > 建站知識 > [分類信息] 如何給dede分類信息的一二級地區(qū)分類

[分類信息] 如何給dede分類信息的一二級地區(qū)分類

POST TIME:2017-11-13 14:39

如何給dede分類信息的一二級地區(qū)分類設(shè)定不同樣式
官方默認模板中的效果如圖:
這樣擠在一起很不好看,我現(xiàn)在想把“北京市”和后面的地區(qū)分別設(shè)定不同的樣式,例如分成兩塊兒。織夢網(wǎng)絡(luò)公司跟板網(wǎng)下面說下修改步驟。
一、先來查看代碼:
分類信息列表頁模板: /templets/default/list_infos.htm
模板處調(diào)用上面數(shù)據(jù)的代碼是:


  1. {dede:infolink}
  2. <tableid='dedeinfolink'>
  3. <tr>
  4. <tdcolspan='3'class='iftitle'>
  5. 信息附加條件:
  6. </td>
  7. </tr>
  8. <tr>
  9. <tdwidth='50'>&nbsp;地區(qū):</td>
  10. <tdalign='center'nowrap='yes'>
  11. <div>[field:linkallplace/]</div>
  12. </td>
  13. <td>
  14. [field:nativeplace/]
  15. </td>
  16. </tr>
  17. <tr><tdcolspan='3'class='spline'>&nbsp;</td></tr>
  18. <tr>
  19. <td>&nbsp;類型:</td>
  20. <tdalign='center'nowrap='yes'>
  21. <div>[field:linkalltype/]</div>
  22. </td>
  23. <td>
  24. [field:infotype/]&nbsp;
  25. </td>
  26. </tr>
  27. <tr><tdcolspan='3'class='spline'>&nbsp;</td></tr>
  28. </table>
  29. {/dede:infolink}

前臺的html代碼是:


  1. <tableid='dedeinfolink'>
  2. <tr>
  3. <tdcolspan='3'class='iftitle'>
  4. 信息附加條件:
  5. </td>
  6. </tr>
  7. <tr>
  8. <tdwidth='50'>&nbsp;地區(qū):</td>
  9. <tdalign='center'nowrap='yes'>
  10. <divstyle="color:#FF0000;font-size:12px;font-weight:bold;"><ahref='/plus/list.php?channelid=-8&tid=9&infotype=0'>不限</a></div>
  11. </td>
  12. <td>
  13. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1000&infotype=0'><b>北京市</b></a>&gt;&gt;<ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1001&infotype=0'>東城區(qū)</a>
  14. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1002&infotype=0'>西城區(qū)</a>
  15. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1003&infotype=0'>崇文區(qū)</a>
  16. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1004&infotype=0'>宣武區(qū)</a>
  17. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1005&infotype=0'>朝陽區(qū)</a>
  18. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1006&infotype=0'>豐臺區(qū)</a>
  19. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1007&infotype=0'>石景山區(qū)</a>
  20. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1008&infotype=0'>海淀區(qū)</a>
  21. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1009&infotype=0'>門頭溝區(qū)</a>
  22. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1010&infotype=0'>房山區(qū)</a>
  23. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1011&infotype=0'>通州區(qū)</a>
  24. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1012&infotype=0'>順義區(qū)</a>
  25. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1013&infotype=0'>昌平區(qū)</a>
  26. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1014&infotype=0'>大興區(qū)</a>
  27. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1015&infotype=0'>懷柔區(qū)</a>
  28. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1016&infotype=0'>平谷區(qū)</a>
  29. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1017&infotype=0'>密云縣</a>
  30. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1018&infotype=0'>延慶縣</a>
  31. &nbsp;
  32. </td>
  33. </tr>
  34. <tr><tdcolspan='3'class='spline'>&nbsp;</td></tr>
  35. <tr>
  36. <td>&nbsp;類型:</td>
  37. <tdalign='center'nowrap='yes'>
  38. <div><ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1000'>不限</a></div>
  39. </td>
  40. <td>
  41. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=500&nativeplace=1000'>商品</a>
  42. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=1000&nativeplace=1000'>租房</a>
  43. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=1500&nativeplace=1000'>交友</a>
  44. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=2000&nativeplace=1000'>招聘</a>
  45. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=2500&nativeplace=1000'>求職</a>
  46. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=3000&nativeplace=1000'>票務(wù)</a>
  47. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=3500&nativeplace=1000'>服務(wù)</a>
  48. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=4000&nativeplace=1000'>培訓(xùn)</a>
  49. &nbsp;
  50. </td>
  51. </tr>
  52. <tr><tdcolspan='3'class='spline'>&nbsp;</td></tr>
  53. </table>

內(nèi)容分別對應(yīng)相同部分的調(diào)用標(biāo)簽。知道了這個下面就可以來開始添加樣式了。織夢網(wǎng)站建設(shè)跟板網(wǎng)為地區(qū)的二級分類寫了個樣式,讓它好跟“北京市”分行分離開。樣式為.ythwxb 二、開始添加樣式。 打開控制分類信息標(biāo)簽的文件/include/taglib/infolink.lib.php 找到下面的代碼:


  1. $fields['nativeplace']="<ahref='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$toptype}&infotype={$infotype}'><b>{$em_nativeplaces[$toptype]}</b></a>&gt;&gt;";
  2. foreach($em_nativeplacesas$eid=>$em)
  3. {
  4. if($eid<$toptype+1||$eid>$toptype+499)continue;
  5. if($eid==$nativeplace){
  6. $fields['nativeplace'].="<b>{$em}</b>\r\n";
  7. }
  8. else{
  9. $fields['nativeplace'].="<ahref='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";

現(xiàn)在我們開始來添加html代碼。 1、將&gt;&gt;修改為<div class=ythwxb> 2、打開 /templets/default/list_infos.htm 文件在代碼:


  1. <tr>
  2. <tdwidth='50'>地區(qū):</td>
  3. <tdalign='center'nowrap='yes'>
  4. <div>[field:linkallplace/]</div>
  5. </td>
  6. <td>
  7. [field:nativeplace/]
  8. </td>
  9. </tr>

的[field:nativeplace /]后添加代碼</div>即可。 保存文件,刷新頁面。前臺已經(jīng)更改過來了。



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 朝阳县| 故城县| 新源县| 米林县| 华容县| 阿合奇县| 昆山市| 黎城县| 新田县| 根河市| 博湖县| 大埔县| 望都县| 岳阳县| 依兰县| 江达县| 大安市| 德庆县| 兴业县| 四会市| 张掖市| 尼玛县| 礼泉县| 岳池县| 柞水县| 屏东市| 大关县| 鄂温| 荣成市| 平阳县| 克拉玛依市| 信丰县| 榆社县| 广州市| 宝山区| 图们市| 定结县| 盐边县| 明光市| 田东县| 平江县|