织梦cms教程

dedecms自动生成RSS和网站地图

我的站长站 2020-04-18 人阅读

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

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

一、RSS

页面标题:rss

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

文件名:rss.xml

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

<?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

<?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>
    相关推荐
    • 网站地图
    • 百度ueditor编辑器插入地图空白的解决方法

      解决方法修改配置文件ueditor.config.js搜索: whitList 增加下面第二行iframe即可,whitList:{ iframe: [&#39;frameborder&#39;,&#39;border&#39;,&#39;marginwidth&#39;,&#39;marginheight&#39;,&#39;width&#39;,&#39;height&#39;,&#39;src&...

      经验分享 896 5年前
    • 网站程序站点地图制作大全

      在咱们日常平凡建站的过程当中,大多数的同伙所采用的建站法式都是ecshop,织梦,wordpress,帝国CMS,Zblog等,这么多的法式在优化的时刻都不可避免一个成绩,那便是在网站内建一个网站舆图,以供爬虫来疾速的匍匐网站的链接,进步网站的收录率。然则分歧的法式都有...

      经验分享 500 7年前
    • 帝国CMS网站地图sitemap教程

      增加自定义页面文件名及存放目录:../../sitemap/sitemap.xml <?='<?xml version="1.0" encoding="UTF-8"?>'?> <urlset xmlns="htt

      帝国cms教程 511 10年前
    最新更新