Hide Elements from Layout Part Orchard CMS

Hide Elements from Layout Part Orchard CMS

Layout Part in Orchard CMS is a very powerful tool, but it is complicated for the end user (content editor), as you can see in this picture:

Also the Dashboard sometimes can be complicated for a non-developer user. In almost every Orchard CMS Website I use in TheAdmin Theme a noadmin.css file. This file is called only when the user in not the Admin and hides things from the end user.

Add the noadmin.css file in the Styles folder in the TheAdmin Theme. Add these line of code in the TheAdmin Theme in the Layout.cshtml file to call the noadmin.css file:

@{

    if(!AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner)) {

        Style.Include("noadmin.css").AtHead();

    }

}

 

The easiest to understand elements for a Content Editor, and absolutely necessary are:

  • HTML
  • Image
  • Grid
  • Row (1 col, 2 col, 3 col, 4 col, 6 col, 12 col)

Your Layout Part will look like this:

Feel free to edit the noadmin.css for any change you want to do to the Dashboard.

You can download the above files from my GitHub.