| 在一个网站中网站地图是不能少的,有网站地图不仅可以提升网站浏览者的用户体验,还可以让蜘蛛更好的抓取网站,让网站有一个更好的收录和排名。织梦制作xml网站地图的方法步骤:
 第一步:分别打开/dede/inc/inc_menu.php和/dede/inc/inc_menu_map.php文件 找到 <m:item name='更新主页HTML' link='makehtml_homepage.php' rank='sys_MakeHtml' target='main' />修改为:
 <m:item name='更新Sitemap' link='makehtml_sitemap.php' rank='sys_MakeHtml' target='main' />
 第二步:制作dede/makehtml_sitemap.php文件 拷贝一个dede/makehtml_homepage.php文件找到$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet); $pv->SaveToHtml($homeFile);
 这段代码直接删除,底部修改调用生成文件模板为makehtml_sitemap.htm,然后另存为makehtml_sitemap.php,上传至dede/即可。
 第三步:制作后台更新模板文件dede/templets/makehtml_sitemap.htm 拷贝一个dede/templets/makehtml_homepage.htm文件找到
 <input name="templet" type="text" id="templet" style="width:300″ value="<?php echo $row['templet']?>">
 修改为:
 <input name="templet" type="text" id="templet" style="width:300″ value="default/sitemap.xml">
 找到
 <td height="20″ valign="top" bgcolor="#FFFFFF"><input name="position" type="text" id="position" value="<?php echo $row['position']?>" size="30″>
 修改为:
 <td height="20″ valign="top" bgcolor="#FFFFFF"><input name="position" type="text" id="position" value="../sitemap.xml" size="30″>
 然后另存为makehtml_sitemap.htm,上传至dede/templets/;
 第四步:制作sitemap模板文件,即templets/sitemap.xml 将一下代码保存为sitemap.xml即可(责任编辑:最模板)<?xml version="1.0" encoding="gb2312"?>
 <?xml-stylesheet type="text/xsl" href="/templets/css/sitemap.xsl"?><!-- generator="dedecms/3.2" -->
 <urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
 <url>
 <loc>http://www.最模板zuimoban.comm</loc>
 <lastmod>
 {dede:arclist row=1 titlelen=30 orderby=pubdate}
 [field:pubdate function=strftime('%Y-%m-%d',@me)/]
 {/dede:arclist}
 </lastmod>
 <changefreq>daily</changefreq>
 <priority>1.0</priority>
 </url>
 {dede:channel row='30' type='top'}
 <url>
 <loc>[field:typelink /]</loc>
 <changefreq>daily</changefreq>
 <priority>0.8</priority>
 </url>
 {/dede:channel}
 {dede:arclist row=2000 orderby=pubdate}
 <url>
 <loc>[field:arcurl/]</loc>
 <lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod>
 <changefreq>monthly</changefreq>
 </url>
 {/dede:arclist}
 </urlset>
 |