dedecms自动生成RSS和网站地图

相关案例演示

dedecms自动生成RSS和网站地图有两种方法可以建立,这里我只说最简单的一种:

核心->频道模型->单页文档管理:增加一个页面 。

一、RSS

页面标题:rss

模板文件名:{style}/rss.htm

文件名:rss.xml

rss.htm 文件必须要放在模版文件夹中:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="gb2312" ?>
<rss version="2.0">
<channel>
<title>RSS_{dede:global.cfg_webname/}</title>
<link>{dede:global.cfg_basehost/}</link>
<description>{dede:global.cfg_description/}</description>
{dede:arclist row='60' col='1' titlelen='100' orderby='pubdate'}
<item>
<title><![CDATA[[field:title function='html2text(@me)'/]]]></title>
<link>[field:arcurl/]</link>
<description><![CDATA[[field:description function='html2text(@me)'/] ...
]]></description>
<pubDate>[field:pubdate function='strftime("%a, %d %b %Y %H:%M:%S",@me)'/]</pubDate>
</item>
{/dede:arclist}
</channel>
</rss>

二、网站地图

页面标题:网站地图

模板文件名:{style}/google_sitemap.htm

文件名:sitemap.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!--  created with Free Online Sitemap Generator www.xml-sitemaps.com
-->
<url>
<loc>http://域名/index.html</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
{dede:channelartlist}
<url>
<loc>{dede:field name="typeurl"/}</loc>
<changefreq>daily</changefreq>
<priority>0.9</priority>
</url>
{dede:channel type="son"}
<url>
<loc>[field:typeurl/]</loc>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
{/dede:channel}
{dede:artlist row="20"}
<url>
<loc>[field:arcurl/]</loc>
</url>
{/dede:artlist}
{/dede:channelartlist}
</urlset>

免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。


来源:网友投稿 关注: 时间:2020-08-11 09:15
首先声明,只要是我们的vip会员所有源码均可以免费下载,不做任何限制(了解更多)
☉本站的源码不会像其它下载站一样植入大量的广告。为了更好的用户体验以后坚持不打水印
☉本站只提供精品织梦源码,源码在于可用,不在多!!希望在这里找到你合适的。
☉本站提供的整站织梦程序,均带数据及演示地址。可以在任一源码详情页查看演示地址
☉本站所有资源(包括源码、模板、素材、特效等)仅供学习与参考,请勿用于商业用途。
☉如有其他问题,请加网站客服QQ进行交流。
相关织梦教程
QQ在线咨询