Replies: 2 comments 5 replies
-
not completely true, you can override module’s views from theme. https://docs.orchardcore.net/en/latest/docs/reference/modules/Templates/#overriding-views |
Beta Was this translation helpful? Give feedback.
-
@ns8482e it works and here are what we need to do:
@ns8482e putting a custom *.cshtml file in a them is great for controlling appearance of our website. I think if a Register view is a normal shape, we can create an alternate shape dynamically with |
Beta Was this translation helpful? Give feedback.
-
Hello everyone.
I am trying to custom a register page by minimize duplicated code because what I want to change are:
I got some progress and can save first name and last name to a user entity.
However,
I can't remove a Username text box
because it is not a shape like Orchard V1 which we can override its template by putting a newRegister.cshtml
file in a View folder of the active theme.Here is the implement or Orchard V1:
https://github.com/OrchardCMS/Orchard/blob/dev/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs#L140
The implementation of Orchard Core CMS (V2):
https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Users/Controllers/RegistrationController.cs#L106
In Orchard Core CMS, we only return a normal ASP.NET Core MVC's view which cannot be overridden.
Therefore, could you please give me some suggestions to override a Register.cshtml page or should we change the Register Action method to return a Register shape which uses Register.cshtml template that we can override in an active theme?
Thank you so much.
CC @Skrypt
Beta Was this translation helpful? Give feedback.
All reactions