Remove Sign in Link in Orchard Footer
-
27-10-2019 - |
Question
I want to remove the sign in link in the very bottom footer of my Orchard site. I want to go to the link /Users/Account/LogOn to login and not have the link displayed. I don't think its necessary on a public facing site and shouldn't be there.
I can only seem to remove or edit the regular footer. Does anyone know how I can do this?
EDIT - I'd also like to be able to remove the publish date from the content. I don't need the date published to be displayed on a simple about page. Does this functionality exist, is it not intuitive to fix.... or am I just a bit slow.
Solution
I managed to remove the sign in link in a semi-friendly fashion:
- Find
Orchard\src\Orchard.Web\Core\Shapes\Views\User.cshtml
- Copy it to the
\Views\
directory of the theme you are using - Remove the else portion of the branch statement so that it just reads as below.
Hope that helps...
if (Request.IsAuthenticated) {
... blah ...
}
OTHER TIPS
if you are using Contoso ot TheThemeMachine you can go to the layout.cshtml and remove following line
WorkContext.Layout.Footer.Add(New.User(), "10"); // Login and dashboard links
That line is responsible for injecting user part into the page
If you are using TheThemeMachine theme, modify the BadgeOfHonor.cshtml in the views directory to modify the footer. To remove the publish date you need to add:
<placement>
<Match ContentType="Page">
<Match DisplayType="Summary">
<Place Parts_Common_Metadata="-"/>
</Match>
<Match DisplayType="Detail">
<Place Parts_Common_Metadata="-"/>
</Match>
</Match>
</placement>
to the Placement.info file, if you do not have one yet, you create one in the root of your theme directory.
Like Richard Stale show:
- Find Orchard\src\Orchard.Web\Core\Shapes\Views\User.cshtml
- Copy it to the \Views\ directory of the theme you are using
- Add in the else portion of the branch statement so that it just reads as below
else if (ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString() != "LogOn")