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
<?xmlversion="1.0"encoding="gb2312"?>
<rssversion="2.0">
<channel>
<title>RSS_{dede:global.cfg_webname/}</title>
<link>{dede:global.cfg_basehost/}</link>
<description>{dede:global.cfg_description/}</description>
{dede:arclistrow='60'col='1'titlelen='100'orderby='pubdate'}
<item>
<title><![CDATA[[field:titlefunction='html2text(@me)'/]]]></title>
<link>[field:arcurl/]</link>
<description><![CDATA[[field:descriptionfunction='html2text(@me)'/]...
]]></description>
<pubDate>[field:pubdatefunction='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
<?xmlversion="1.0"encoding="UTF-8"?>
<urlsetxmlns="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.9http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!--createdwithFreeOnlineSitemapGeneratorwww.xml-sitemaps.com
-->
<url>
<loc>http://域名/index.html</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
{dede:channelartlist}
<url>
<loc>{dede:fieldname="typeurl"/}</loc>
<changefreq>daily</changefreq>
<priority>0.9</priority>
</url>
{dede:channeltype="son"}
<url>
<loc>[field:typeurl/]</loc>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
{/dede:channel}
{dede:artlistrow="20"}
<url>
<loc>[field:arcurl/]</loc>
</url>
{/dede:artlist}
{/dede:channelartlist}
</urlset>

本文dedecms自动生成RSS和网站地图到此结束。当你觉得没有人来爱你,别人看见的就是可怜兮兮,毫无魅力的你。小编再次感谢大家对我们的支持!

您可能有感兴趣的文章
织梦dede手机站关闭自动生成首页index.html

织梦采集没有自动生成摘要和关键字怎么办

dedecms后台自动生成sitemap.html放入到站点根目录的方法

DeDecms如何取消自动生成关键字

DedeCMS栏目伪静态后仍然自动生成空文件夹的如何解决方法