如何使 MvcSitemapNode 仅在 google 站点地图中可见,但在菜单中不可见
I want to make some some nodes in my Mvc.sitemap to be visible only in google sitemap, there is no needs to display them in menu.
Is there any way i can achieve that?
Probably i need somehow to play with attribute visibility
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如 GitHub Wiki 上的高级节点可见性中所述,您必须将可见性提供程序更改为 FilteredSiteMapNodeVisibilityProvider 并将“可见性”添加到 attributeToIgnore:
完成此操作后,您必须将可见性属性添加到要隐藏的所有节点。该属性应设置为:
As described in the Advanced Node Visibility on the GitHub Wiki, you have to change the visibility provider to FilteredSiteMapNodeVisibilityProvider and add "visibility" to attributesToIgnore:
When this have been done you have to add the visibility attribute to all the nodes you want to hide. The attribute should be set to: