欢迎来到万象站长学堂!

DedeCMS

当前位置: 主页 > CMS教程 > DedeCMS > 文章列表

dedecms自动生成RSS和网站地图

时间:2026-11-16 20:25:17|栏目:DedeCMS|点击:1 次

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>

    上一篇:织梦CMS手机模板安装教程

    栏    目:DedeCMS

    下一篇:dedecms附件上传大小限制

    本文标题:dedecms自动生成RSS和网站地图

    本文地址:https://zhanzhang.eapis.site/html/23965.html

    您可能感兴趣的文章

    广告投放 | 联系我们 | 版权申明

    重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

    如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

    联系QQ:120507403 | 邮箱:120507403@qq.com

    Copyright © 2002-2026 万象站长学堂 版权所有沪ICP备2021023961号-8 粤公网安备 13010202004186