Reputation: 1710
I need to be able to dynamically set the home page of an Orchard site based on differing factors.
Normally, I could create rule providers or theme selectors to dynamically change the theme/ widgets on a page. However- some of the pages that need to be set as the home page are just normal MVC pages and therefore layer rules will not do in this case.
I've looked at the alias module, and think this would be a good starting point. For example, I could say when the user hits /
and certain criteria are met, then route to /controller/action/123
etc....
Ignoring the issue of how to implement the decision making logic, can anyone suggest the best way for me to achieve what I'm aiming to do?
Upvotes: 2
Views: 962
Reputation: 13366
The easiest way would be to override the route for "/"
to point to your custom controller. Make decision there and either perform a redirect, transfer the request or return varying results.
It could also be done on a lower level but this is way more complicated (using custom route implementation, route handler etc. - similar to what Orchard.Alias
module does). Extending Orchard.Alias
to take into account custom logic in addition to or replacing the current simple path-matching logic would be a way to go then.
Upvotes: 1