[帝国] 帝国sitemap生成代码_无需插件(首页栏目文章tag标签)

[复制链接]
sheep 发表于 2022-12-29 18:08:47 | 显示全部楼层 |阅读模式

帝国cms生成sitemap源码,无需安装插件。帝国CMS怎么制作网站sitemap?帝国如何自动生成sitemap?以下代码可生成首页、栏目页、文章页及tag标签页链接,包含链接、时间、更新频率、权重分配

首页打开帝国后台,栏目—自定义页面-增加自定义页面,选择:直接页面式 设置页面名称为sitemap.xml ,修改文件名为:../../sitemap.xml (根目录)
(完成后注意每次更新需要刷新自定义页面)
注意:
1、如果文章链接不是绝对路径,需确保
    ①系统参数网站地址填写域名
    ②系统-数据更新-更新信息页地址后更新自定义页面即可
2、如果你的tag链接形式不是默认的动态链接:e/tags/?tagname=关键词,以下sitemap生成代码tag部分则需要修改tag链接调用方式
tag标签调用参考以下文档,进入页面后f12搜索tag:
《帝国cms常用调用标签方法大全(灵动_万能)》http://www.sheepyc.com/thread-432-1-1.html
帝国sitemap完整生成代码如下:
  1. <?='<?xml version="1.0" encoding="UTF-8"?>'?>
  2. <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  3. <url>
  4. <loc>[!--news.url--]</loc>
  5. <lastmod><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
  6. <changefreq>Always</changefreq>
  7. <priority>1.00</priority>
  8. </url>
  9. [e:loop={"select * from [!db.pre!]enewsclass order by myorder",0,24,0}]
  10. <?
  11. if($bqr['classurl']=='')
  12. {
  13. $sccurl=$public_r['newsurl'].$bqr['classpath']."/";
  14. }
  15. else
  16. {
  17. $sccurl=$bqr['classurl']."/";
  18. }
  19. ?>
  20. <url>
  21. <loc><?=$sccurl?></loc>
  22. <lastmod><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
  23. <changefreq>Always</changefreq>
  24. <priority>0.80</priority>
  25. </url>
  26. [/e:loop]

  27. [e:loop={"select * from [!db.pre!]enewstags order by num DESC limit 20",0,24,0}]
  28. <url>
  29. <loc><?=$public_r[newsurl]?>e/tags/?tagname=<?=$bqr['tagname']?></loc>
  30. <lastmod><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
  31. <changefreq>Always</changefreq>
  32. <priority>0.60</priority>
  33. </url>
  34. [/e:loop]

  35. [e:loop={"select * from [!db.pre!]enewszt order by ztid",0,24,0}]
  36. <?
  37. if($bqr['zturl']=='')
  38. {
  39. $sccurl=$public_r['newsurl'].$bqr['ztpath']."/";
  40. }
  41. else
  42. {
  43. $sccurl=$bqr['zturl']."/";
  44. }
  45. ?>
  46. <url>
  47. <loc><?=$sccurl?></loc>
  48. <lastmod><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
  49. <changefreq>daily</changefreq>
  50. <priority>0.6000</priority>
  51. </url>
  52. [/e:loop]
  53. [e:loop={"select * from [!db.pre!]ecms_news order by newstime desc",0,24,0}]
  54. <url>
  55. <loc><?=$bqsr[titleurl]?></loc>
  56. <lastmod><?php echo date("Y-m-d H:i:s") ; ?></lastmod>
  57. <changefreq>daily</changefreq>
  58. <priority>0.60</priority>
  59. </url>
  60. [/e:loop]
  61. </urlset>
复制代码







您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注公众号
Archiver|手机版|小黑屋|社区规范|绵羊优创

相关侵权、举报、投诉及建议等,请发 E-mail:2363400792@qq.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|京ICP备19037745号-2公安备案京公网安备11011502037529号

在本版发帖
关注公众号
QQ客服返回顶部
来点音乐
优聚封面
歌曲名称
歌手名称
0:00 0:00
顺序播放
歌词加载中...