織夢DEDECMS網站如何生成xml格式網站地圖


這個很簡單,按照我下邊提供的方法進行操作就可以了,我一直在用

第一步,登陸DedeCMS后台:核心 - 頻道模型- 自由列表管理,點擊添加列表;

參數按照下邊的填寫;

自由列表標題:【XML地圖】

列表HTML存放目錄:{cmspath}/

目錄默認頁名稱:sitemap.xml

命名規則:{listdir}/sitemap.xml

列表模板:{style}/sitemap_xml.htm

每頁記錄數:30000

限定頻道:普通文章

復制下邊代碼寫成模版,命名為:sitemap_xml.htm

<?xml version="1.0" encoding="{dede:global.cfg_soft_lang/}"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
    <loc>{dede:global.cfg_cmsurl/}</loc>
    <lastmod>{dede:arclist row=1 titlelen=24 orderby=pubdate}
    [field:pubdate function=strftime('%Y-%m-%d',@me)/]
    {/dede:arclist}</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
</url>
{dede:channel row='23' type='top'}
<url>
<loc>[field:typelink /]</loc>
<changefreq>daily</changefreq>
<priority>0.9</priority>
</url>
{/dede:channel}
{dede:channel type='son' typeid ='9'}
<url>
<loc>[field:typelink /]</loc>
<changefreq>daily</changefreq>
<priority>0.9</priority>
</url>
{/dede:channel}
{dede:arclist row='20000' orderby='pubdate'}
<url>
    <loc>[field:arcurl/]</loc>
    <lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod>
    <changefreq>0.7</changefreq>
</url>
{/dede:arclist}
<url>
<loc>http://127.0.0.1/tags.html</loc>
<lastmod>daily</lastmod>
<changefreq>0.8</changefreq>
</url>
{dede:tag getall='1' }
<url>
    <loc>[field:link/]</loc>
    <lastmod>daily</lastmod>
    <changefreq>0.8</changefreq>
</url>
{/dede:tag}
</urlset>

不需要的tag調用的話直接刪掉就可以了

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM