orchard cms routing question

后端 未结 1 971
时光取名叫无心
时光取名叫无心 2021-02-20 03:23

I have created some custom content types which include the route part so my content managers can edit the slugs for the items. I am having no luck configuring a route that will

相关标签:
1条回答
  • 2021-02-20 03:42

    You can serve those items from your own controller too, sure. The only thing needed is a route that would reach your controller. Then, you can return pretty much anything you want:)

    It looks like your URLs are being matched by some other route(s). If you want to override the default route and make sure your one would be compared first, you should specify a higher priority (eg. 11). The catch-all route in Orchard.Core.Routable.Routes has a priority of 10, so will catch even the URLs matching your routes.

    You haven't provided a default value for id in the first route - that can also pose a problem. If you don't explicitly specify id in an URL, it won't be matched.

    Btw, is Area a proper name for the default controller in the first route, or just a typo?

    0 讨论(0)
提交回复
热议问题