您现在的位置是:首页 > cms教程 > DedeCMS教程DedeCMS教程

dede织梦分类信息一二级地区分类不同样式的实现方法

甘风力2023-10-03DedeCMS教程已有人查阅

导读如何给dede分类信息的一二级地区分类设定不同样式,这样挤在一起很不好看,我现在想把“北京市”和后面的地区分别设定不同的样式,例如分成两块儿。

如何给dede分类信息的一二级地区分类设定不同样式,这样挤在一起很不好看,我现在想把“北京市”和后面的地区分别设定不同的样式,例如分成两块儿。织梦网络公司代码号下面说下修改步骤。
一、先来查看代码:
分类信息列表页模板: /templets/default/list_infos.htm
模板处调用上面数据的代码是:
{dede:infolink}  
<table id='dedeinfolink'> 
<tr> 
<td colspan='3' class='iftitle'> 
  信息附加条件:  
</td> 
</tr> 
<tr> 
<td width='50'>&nbsp;地 区:</td> 
<td align='center' nowrap='yes'> 
  <div>[field:linkallplace/]</div> 
</td> 
<td> 
   [field:nativeplace /]  
</td> 
</tr> 
<tr><td colspan='3' class='spline'>&nbsp;</td></tr> 
<tr> 
<td>&nbsp;类 型:</td> 
  <td align='center' nowrap='yes'> 
   <div>[field:linkalltype/]</div> 
  </td> 
  <td> 
   [field:infotype /]&nbsp;  
  </td> 
</tr> 
<tr><td colspan='3' class='spline'>&nbsp;</td></tr> 
</table> 
{/dede:infolink}   
前台的html代码是:
<table id='dedeinfolink'> 
<tr> 
<td colspan='3' class='iftitle'> 
  信息附加条件:  
</td> 
</tr> 
<tr> 
<td width='50'>&nbsp;地 区:</td> 
<td align='center' nowrap='yes'> 
  <div style="color:#FF0000; font-size:12px; font-weight:bold;"><a href='/plus/list.php?channelid=-8&tid=9&infotype=0'>不限</a></div> 
</td> 
<td> 
   <a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1000&infotype=0'> <b>北京市</b></a> &gt;&gt;  <a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1001&infotype=0'>东城区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1002&infotype=0'>西城区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1003&infotype=0'>崇文区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1004&infotype=0'>宣武区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1005&infotype=0'>朝阳区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1006&infotype=0'>丰台区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1007&infotype=0'>石景山区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1008&infotype=0'>海淀区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1009&infotype=0'>门头沟区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1010&infotype=0'>房山区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1011&infotype=0'>通州区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1012&infotype=0'>顺义区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1013&infotype=0'>昌平区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1014&infotype=0'>大兴区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1015&infotype=0'>怀柔区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1016&infotype=0'>平谷区</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1017&infotype=0'>密云县</a> 
<a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1018&infotype=0'>延庆县</a> 
&nbsp;  
</td> 
</tr> 
<tr><td colspan='3' class='spline'>&nbsp;</td></tr> 
<tr> 
<td>&nbsp;类 型:</td> 
  <td align='center' nowrap='yes'> 
   <div><a href='/plus/list.php?channelid=-8&tid=9&nativeplace=1000'>不限</a></div> 
  </td> 
  <td> 
    <a href='/plus/list.php?channelid=-8&tid=9&infotype=500&nativeplace=1000'>商品</a> 
<a href='/plus/list.php?channelid=-8&tid=9&infotype=1000&nativeplace=1000'>租房</a> 
<a href='/plus/list.php?channelid=-8&tid=9&infotype=1500&nativeplace=1000'>交友</a> 
<a href='/plus/list.php?channelid=-8&tid=9&infotype=2000&nativeplace=1000'>招聘</a> 
<a href='/plus/list.php?channelid=-8&tid=9&infotype=2500&nativeplace=1000'>求职</a> 
<a href='/plus/list.php?channelid=-8&tid=9&infotype=3000&nativeplace=1000'>票务</a> 
<a href='/plus/list.php?channelid=-8&tid=9&infotype=3500&nativeplace=1000'>服务</a> 
<a href='/plus/list.php?channelid=-8&tid=9&infotype=4000&nativeplace=1000'>培训</a> 
&nbsp;  
  </td> 
</tr> 
<tr><td colspan='3' class='spline'>&nbsp;</td></tr> 
</table> 
内容分别对应相同部分的调用标签。知道了这个下面就可以来开始添加样式了。织梦网站建设代码号为地区的二级分类写了个样式,让它好跟“北京市”分行分离开。样式为.ythwxb
二、开始添加样式。
打开控制分类信息标签的文件/include/taglib/infolink.lib.php
找到下面的代码:
$fields['nativeplace'] = "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$toptype}&infotype={$infotype}'> <b>{$em_nativeplaces[$toptype]}</b></a> &gt;&gt; ";  
foreach($em_nativeplaces as $eid=>$em)  
{  
if($eid < $toptype+1 || $eid > $toptype+499) continue;  
if($eid == $nativeplace) {  
$fields['nativeplace'] .= " <b>{$em}</b>\r\n";  
}  
else {  
$fields['nativeplace'] .= " <a href='{$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 文件在代码:
<tr> 
<td width='50'> 地 区:</td> 
<td align='center' nowrap='yes'> 
<div>[field:linkallplace/]</div> 
</td> 
<td> 
[field:nativeplace /]  
</td> 
</tr> 
的[field:nativeplace /]后添加代码</div>即可。
保存文件,刷新页面。前台已经更改过来了。

本文标签:

很赞哦! ()

相关源码

  • 帝国cms7.5手游评测资讯礼包合集游戏专区下载网站模板本模板基于帝国CMS系统开发,为手游门户网站设计。支持PC端与移动端同步生成HTML静态页面,内置多端同步生成功能。模板架构针对手业特点优化,满足APP下载、游戏资讯、攻略等内容发布需求。查看源码
  • 自适应建材瓷砖卫浴大理石类pbootcms网站模板源码下载为建材瓷砖、卫浴瓷砖企业打造的高端响应式门户模板,基于PbootCMS内核深度开发。采用前沿HTML5自适应架构,无缝兼容手机端触控交互与PC端展示场景。查看源码
  • (PC+WAP)绿色资源回收新能源环保设备pbootcms源码下载基于PbootCMS系统深度开发的环保行业模板,特别适配资源回收设备、新能源技术、环境治理装备等企业的线上展示需求。集成产品库、解决方案、环保案例等专业模块,助力企业高效传递绿色价值。查看源码
  • (PC+WAP)绿色产品环保设备垃圾桶厂家公司网站pbootcms模板为垃圾桶生产商、环保设备企业打造的高端响应式门户模板,基于PbootCMS开源内核深度开发。采用HTML5自适应架构,无缝实现PC与手机端数据实时同步与交互优化查看源码
  • (自适应响应式)动力刀座五金机械设备pbootcms网站源码下载为动力刀座及五金机械企业定制的响应式网站框架,基于PbootCMS系统深度开发,助力传统制造企业实现数字化转型升级。采用手工编写的DIV+CSS前端架构,代码执行效率提升40%。查看源码
  • (自适应响应式)pbootcms紫色美容整形机构企业模板下载基于PbootCMS内核开发的响应式网站模板,为医疗美容机构、整形医院等企业设计,提供完整的线上展示平台采用紫色系配色方案,整体风格专业大气。模板包含首页轮播、服务项目、专家团队、案例展示等核心模块,能够充分展示医疗美容机构的专业服务和特色优势。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐