Jasper
Jasper

Reputation: 1837

Setting module page as home page in Orchard

I have a module in which I created a custom page with controller and some logic. Works fine. I need that page to function as home page for my site. I found some topics about implementing IHomePageProvider, but that seems to be impossible because I can't find the definition of IHomePageProvider in the Orchard core. So I know there are some topics on this subject, but I didn't manage to find a solution that way, so therefore this question.

Upvotes: 0

Views: 2757

Answers (3)

0lukasz0
0lukasz0

Reputation: 3277

When working with Orchard Core (Orchard 2) there is setting with Home Route, which you can specify.

You can set it in your recipe.json file:

{
  "name": "settings",
  "HomeRoute": {
    "Action": "Index",
    "Controller": "ControllerName",
    "Area": "AreaName"
  }
}

or probablly later:

RouteValueDictionary newHomeRouteValue = ...;

var site = await _siteService.GetSiteSettingsAsync();
site.HomeRoute = newHomeRouteValue;
await _siteService.UpdateSiteSettingsAsync(site);

Upvotes: 1

s.ermakovich
s.ermakovich

Reputation: 2674

You can define a home Route and Controller associated with this route. Take a look how it's accomplished in the CulturePicker module: HomeRoutes and LocalizableHomeController

Upvotes: 0

Bertrand Le Roy
Bertrand Le Roy

Reputation: 17814

That is because it was removed at the same time as the routable part. This is now done using Alias.

Upvotes: 1

Related Questions