This project is read-only.

How to override LogOn view

Jan 17, 2011 at 10:59 PM

I'm trying to override the default LogOn.cshtml view that lives in the Orchard.Users module but I can't find out how. I know that if this was a shape I could copy the file to my custom theme and modify it to my own needs, but that isn't the case! What's the best way to solve this kind of problems? The reason for this is that I want to hide the "Sign In" anchor tag without touching the Orchard codebase.

Jan 18, 2011 at 1:32 AM

It is a shape, and you could still do it if it wasn't one. To do it, copy paste the original LogOn.cshtml to your theme's Views folder, and update it as you whish.



Jan 18, 2011 at 5:59 PM

Are you sure it's a shape? I think it's a view that is rendered from a normal controller action, already tried to copy paste LogOn.cshtml to my theme's view folder! So what would be the alternative? Thanks.

Jan 18, 2011 at 6:23 PM

Yes, I am more than sure. If you check the Account controller, you'll see it's returning a ShapeResult, and also the LogOn.cshtml file is right under Views, and not under Views/Account. This was a request from Nick Mayne, our famous contributor.

Jan 18, 2011 at 9:02 PM

I didn't notice that it returns a ShapeResult, but unfortunately it still doesn't pick my own LogOn.cshtml. What could be the problem? It's still difficult to debug this kind of shape problems.

Jan 19, 2011 at 7:19 PM
Edited Jan 19, 2011 at 7:33 PM

I'm also trying to override LogOn.cshtml


Placing it in Views of Theme doesn't seem to work

somewhow after a few minutes it started working...

Jan 19, 2011 at 9:49 PM

This discussion can be deleted, I needed User.cshtml... stupid!