织梦园模板网提供云优cms模板,pbootcms模板,Wordpress主题模板等各类企业新闻资讯网站模板下载服务。织梦园网站模板交流群
用户名:
密码:
注册
注册后享受折扣价

织梦CMS地图sitemap.html更改路径和模板

织梦园模板 / 2020-09-19 / 收藏
织梦默认的网站地图生成后的路径是/data/sitemap.html
但是做为seo来考虑会认为sitemap.html这个文件放在根目录会更好。
那么如何实现这个呢?
方法如下:
***步:打开/dede/makehtml_map.php
if($dopost=="site")
{
$murl = $cfg_cmspath."/data/sitemap.html"; //内容来自织梦模板
$tmpfile = $cfg_basedir.$cfg_templets_dir."/plus/sitemap.htm";
}
更改成为
if($dopost=="site")
{
$murl = $cfg_cmspath."/sitemap.html";
$tmpfile = $cfg_basedir.$cfg_templets_dir."/plus/sitemap.htm";
}
这样就实现了sitemap.html放在根目录的的任务了
 
第二步:如何我们要更改sitemap.html的显示方式,及相关的样式,那在哪里更改
1、dedecms中sitemap.html的模板文件在\templets\plus\sitemap.htm,我们可以在这个文件更改相关的样式标题什么的。
2、更改sitemap的显示方式,这个时候我们就要了解{dede:global name='maplist'/}标签了
这个标签,简单点说,你在makehtml_map.php中定义一个$seostudy = "原创小站";,那么在模板中可以使用{dede:global name='seostudy'}来获得这个变量的值,当然这个文件的获取值的函数很多都是来自文件/include/sitemap.class.php,所以我们在更改sitemap.html的时候把这几个文件了解后就很容易了。

相关辅助文档

收缩