加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 如何使用kentico CMS获取GoogleNewsSitemap中的新闻

发布时间:2020-12-16 09:35:47 所属栏目:asp.Net 来源:网络整理
导读:我在我的网站上使用Kentico 5.5R2,我想生成GoogleNewsSitemap.到目前为止,我的代码能够获取newarticle网址和发布日期,但我无法动态获取新闻文章的标题 这是代码 urlloc%# GetAbsoluteUrl(GetDocumentUrl()) %/locnews:newsnews:publicationnews:nameYourwell
我在我的网站上使用Kentico 5.5R2,我想生成GoogleNewsSitemap.到目前为止,我的代码能够获取newarticle网址和发布日期,但我无法动态获取新闻文章的标题
这是代码

<url>
<loc><%# GetAbsoluteUrl(GetDocumentUrl()) %></loc>
<news:news>

<news:publication>
<news:name>Yourwellness </news:name>
<news:language>eng</news:language>
</news:publication>
<news:genres>PressRelease,Blog</news:genres>
<news:publication_date>
<%# GetDateTime("DocumentModifiedWhen","dd-MMM-yy")%>
</news:publication_date>
<news:title>method for fetching title Comes here </news:title>
<news:keywords>Health</news:keywords>
</news:news>
</url>

我尝试了很多方法来获取标题,但它是空白的.

解决方法

<%#Eval(“DocumentName”)%>是节点的默认值,除非您使用自定义文档类型的其他内容

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读