[织梦教程] 修改织梦dedecms的Artlist标签去掉table

[复制链接]
查看2545 | 回复5 | 2018-11-5 09:31:15 | 显示全部楼层 |阅读模式

本文介绍了在dedecms中修改Artlist标签,以去掉table的方法,有需要的朋友参考下。

使用织梦dedecms建站修改模板时,多会遇到织梦自动生成 table,tr,td 等元素。
而 table,tr,td 在织梦中远远不如<div> <li> 好用,站长地带教大家修改成div的方法。
 
在织梦../include/taglib 文件夹 找到arclist.lib.php 文件
 
然后搜索:
 
if($col>1){ $artlist = “<table width=’$tablewidth’ border=’0′ cellspacing=’0′ cellpadding=’0′> ”; }
修改为:
 if($col>1){ $artlist = “ ”; }
查找:
if($col>1) $artlist .= “<tr> ”;
 
修改为:
 
if($col>1) $artlist .= “ ”;
查找:
if($col>1) $artlist .= ” <td width=’$colWidth’ valign=’top’> ”;
 
修改为:
 
if($col>1) $artlist .= ” ”;
查找:
if($col>1) $artlist .= ” </td> ”;
 
修改为:
 
if($col>1) $artlist .= ” ”
查找:
if($col>1){ $artlist .= ” </tr> ”;}
 
修改为:
 
if($col>1){ $artlist .= ” ”;}
查找:
if($col>1) $artlist .= ” </table> ”;
 
修改为:
 
:if($col>1) $artlist .= ” ”;
 
这样去掉所有table(表格)标签,然后在模板里使用channelArtlist标签,最终显示的内容将不再包含这些table元素了。
 
在{dede:channelArtlist}与{/dede:channelArtlist}就能直接调用最终要显示的内容,不会含有多余的html代码了。
织梦教程网络上有很多,但没有一个像自由织梦(www.freedede.cn)这样教程比较齐全的,现在好了,学习开发使用织梦dedecms系 统不用东奔西跑了,直接来自由织梦就好了,提供织梦cms详细的使用教程和织梦建站教程,包括dedecsm的安装、模板开发教程、安 全配置等,DedeCMS从入门到精通建站就是如此轻松。
回复

使用道具 举报

我的苦恼冉 | 2021-10-30 21:22:40 | 显示全部楼层
资源太多了,准备办个会员
回复

使用道具 举报

折失的誓言群 | 2022-5-6 21:03:35 | 显示全部楼层
很不错的资源站
回复

使用道具 举报

yao不回忆 | 2022-6-2 00:20:06 | 显示全部楼层
有情怀的站啊,爱了
回复

使用道具 举报

天然悠然牌 | 2022-11-27 00:06:55 | 显示全部楼层
这个下载站资源真齐全
回复

使用道具 举报

同感丶 | 2023-1-30 13:55:38 | 显示全部楼层
很不错的资源站
回复

使用道具 举报

forregistuse | 2023-5-2 12:05:48 | 显示全部楼层
资源太多了,准备办个会员
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则