婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 網站建設 > 建站知識 > [分類信息] 如何給dede分類信息的一二級地區分類

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

POST TIME:2017-11-13 14:39

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


  1. {dede:infolink}
  2. <tableid='dedeinfolink'>
  3. <tr>
  4. <tdcolspan='3'class='iftitle'>
  5. 信息附加條件:
  6. </td>
  7. </tr>
  8. <tr>
  9. <tdwidth='50'>&nbsp;地區:</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;地區:</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'>東城區</a>
  14. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1002&infotype=0'>西城區</a>
  15. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1003&infotype=0'>崇文區</a>
  16. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1004&infotype=0'>宣武區</a>
  17. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1005&infotype=0'>朝陽區</a>
  18. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1006&infotype=0'>豐臺區</a>
  19. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1007&infotype=0'>石景山區</a>
  20. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1008&infotype=0'>海淀區</a>
  21. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1009&infotype=0'>門頭溝區</a>
  22. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1010&infotype=0'>房山區</a>
  23. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1011&infotype=0'>通州區</a>
  24. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1012&infotype=0'>順義區</a>
  25. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1013&infotype=0'>昌平區</a>
  26. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1014&infotype=0'>大興區</a>
  27. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1015&infotype=0'>懷柔區</a>
  28. <ahref='/plus/list.php?channelid=-8&tid=9&nativeplace=1016&infotype=0'>平谷區</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'>票務</a>
  47. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=3500&nativeplace=1000'>服務</a>
  48. <ahref='/plus/list.php?channelid=-8&tid=9&infotype=4000&nativeplace=1000'>培訓</a>
  49. &nbsp;
  50. </td>
  51. </tr>
  52. <tr><tdcolspan='3'class='spline'>&nbsp;</td></tr>
  53. </table>

內容分別對應相同部分的調用標簽。知道了這個下面就可以來開始添加樣式了。織夢網站建設跟板網為地區的二級分類寫了個樣式,讓它好跟“北京市”分行分離開。樣式為.ythwxb 二、開始添加樣式。 打開控制分類信息標簽的文件/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";

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


  1. <tr>
  2. <tdwidth='50'>地區:</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>即可。 保存文件,刷新頁面。前臺已經更改過來了。



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

  • 400-1100-266
主站蜘蛛池模板: 汉源县| 阜城县| 井冈山市| 炎陵县| 萍乡市| 来凤县| 图木舒克市| 合作市| 城固县| 化德县| 都兰县| 汝南县| 关岭| 大城县| 梁山县| 榆社县| 淮滨县| 陇南市| 盐山县| 青浦区| 宁波市| 黄山市| 永宁县| 古蔺县| 宁国市| 类乌齐县| 名山县| 河西区| 保山市| 阜阳市| 贵州省| 秀山| 桃源县| 恩施市| 汤阴县| 花莲市| 清苑县| 吴江市| 牙克石市| 金坛市| 临泽县|