-
Notifications
You must be signed in to change notification settings - Fork 2.4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to change the default home/landing to my own controller /Home/Index ? #6235
Comments
You don't need to redirect anything. If you specify your controller action's route as the home route (I think just "/" should work), like with attribute routing then that's what will come up when you open the homepage. |
Hi, this doesn't work: |
How exactly is it not working? |
It ignore this route, still directly go to the landing page. |
Let's try to make this work in a simplest way: Please create a controller in your module where the action just returns a string or something, and use attribute routing to hook it to the homepage. Enable the module, then try it out. If it doesn't work then open the action directly with the default route. Let us know if this works and post your code. |
You can change the homepage route by changing it in the database. You will do this SQL Query to find the proper record in the DB : SELECT * FROM Document WHERE Type = 'OrchardCore.Settings.SiteSettings, OrchardCore.Settings'
And then change this part of the JSON data with what you need : {
"HomeRoute": {
"area": "OrchardCore.Contents",
"controller": "Item",
"action": "Display",
"contentItemId": "12121212121212"
}
}
Let's add this to the documentation please as this question is often asked. @agriffard |
@Skrypt I tried to create a Tools module with an admin page to set the HomeRoute. The homeRoute is correctly updated but, it still needs to update the current one to SetHomepage = false and if there is a contentItemId, update the content that has the new contentItemId with SetHomepage = true. If you want to take a look: |
You just need to disable the So if you disable the
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
As I'd like to redirect the homepage to use my own controller /Home/Index
The text was updated successfully, but these errors were encountered: