Kentico 中的新页面未在 googlesitemap.xml 中列出

New pages in Kentico not listing in googlesitemap.xml

设置如下:

事实上,除了机器人文件的位置外,我们的站点地图中没有显示任何内容。

我知道最初它只列出 CMS.MenuItem 个对象(根据 https://docs.kentico.com/k11/configuring-kentico/search-engine-optimization/google-sitemaps)。

是否缺少在站点地图中显示页面的设置?

以防万一:kentico 版本是 10。

确保您的自定义页面类型已在代码文件中配置: 在 ~/CMSPages/googlesitemap.aspx 之前的代码或 ~/CMSPages/googlesitemap.aspx.cs

之后的代码中

由于它类似于转发器,您可以设置类名 属性 来识别您希望它用于呈现的不同页面类型。

例如在之前的代码中:ClassNames="CMS.MenuItem;CMS.News;Custom.Type"

结果如下:

<cms:GoogleSitemap runat="server" ID="googleSitemap" 
    TransformationName="CMS.Root.GoogleSiteMap" CacheMinutes="0"
    OrderBy="NodeLevel, NodeOrder, NodeName"
    ClassNames="CMS.MenuItem;CMS.News;Custom.Type" />