混合站点地图和动态(数据库)页面?

发布于 2024-08-17 00:49:00 字数 980 浏览 2 评论 0原文

我的网站有一个静态 .sitemap 文件。我想为每个主类别(@Products添加 5 个子类别,这样它们就会出现在我的菜单中(菜单是有效的自定义帮助程序,我只需添加到 < code>Sitemap.Provider 运行时的某些页面...)这可能吗?

网站地图:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
  <node controller="Home" action="Index" title="Home" description="Homepage">
    <node controller="Newsroom" action="Index" title="News" description="" />
    <node controller="Products" action="Index" title="Products" description="">
      <node controller="Products" action="MainCat1" title="MainCat1" isDynamic="true" dynamicParameters="category" />
      <node controller="Products" action="MainCat2" title="MainCat2" isDynamic="true" dynamicParameters="category" />
      <node controller="Products" action="MainCat3" title="MainCat3" isDynamic="true" dynamicParameters="category" />
    </node>
  </node>
</siteMap>

i have a static .sitemap file for my site. I want to add 5 subcategories for each maincategory (@Products) so they will appear in my menu (menu is custom helper which works, i just need to add to the Sitemap.Provider some pages at runtime...) Is this possible?

Sitemap:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
  <node controller="Home" action="Index" title="Home" description="Homepage">
    <node controller="Newsroom" action="Index" title="News" description="" />
    <node controller="Products" action="Index" title="Products" description="">
      <node controller="Products" action="MainCat1" title="MainCat1" isDynamic="true" dynamicParameters="category" />
      <node controller="Products" action="MainCat2" title="MainCat2" isDynamic="true" dynamicParameters="category" />
      <node controller="Products" action="MainCat3" title="MainCat3" isDynamic="true" dynamicParameters="category" />
    </node>
  </node>
</siteMap>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扮仙女 2024-08-24 00:49:00

我最终创建了一个自定义的 SiteMapProvider

I ended up creating a custom SiteMapProvider.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文