How to: Hide certain ribbon actions and the created/modified info in the Employee Training Management

Today one of our customers asked how to hide the “Workflows” and “Manage enrollment(s)” actions from the ribbon in the training events list display and in the content type/version/created/modified info at the end of the display form.

Actions and section to hide

I think that this could be helpful for others too, so that’s why I decided to explain it here in more detail.

1. Hide the ribbon actions

To hide the actions from the ribbon, I would recommend changing the „Scheduled trainings” list permissions.

Here is the “permissions” section of the configuration guide: http://www.sharepointsapiens.com/employee-training-management/details/configuration/#Step-6-Permissions

Basically it’s important that all users have contribute permissions in the enrollment and feedback lists and (only) read permissions in all other lists. Organizers require contribute permissions in all lists and manage lists permission in the enrollment and feedback lists to manage enrollments and to access all the feedback.

Back to the particular problem: Make sure that not all users have contribute permissions in the “Scheduled Trainings” list.

For a user with only read permissions, the training form would looks like this:

Training in read only mode

2. Hide the content type/version/created/modified info

To hide the content type, version, created and modified info I would use a simple stylesheet:

The following rule hides this info in all display forms for all users.

form[action*='DispForm.aspx'] #onetIDListForm .ms-descriptiontext { display: none }
form[action*='DispForm.aspx'] #onetIDListForm .ms-descriptiontext { display: none }

If you only want to hide it for a certain list, use the following script and replace the WebPartID with the id of your display’s form web part. Use the IE Developer Tools F12 to get the id of the div.

div[WebPartID='f81349e9-de42-4564-8a4b-7db574750dba'] .ms-descriptiontext { display: none }
div[WebPartID='f81349e9-de42-4564-8a4b-7db574750dba'] .ms-descriptiontext { display: none }

If you don’t want to change the permissions and you want to hide the workflow and manage enrollments action for all users in all lists, you can also use CSS:

form[action*='DispForm.aspx'] a[id^='Ribbon.ListForm.Display.Actions.ManageEnrollmentsTraining'], 
form[action*='DispForm.aspx'] a[id^='Ribbon.ListForm.Display.Manage.Workflows'] { display: none }
form[action*='DispForm.aspx'] a[id^='Ribbon.ListForm.Display.Actions.ManageEnrollmentsTraining'], 
form[action*='DispForm.aspx'] a[id^='Ribbon.ListForm.Display.Manage.Workflows'] { display: none }

You can save all rules to one .css file in the SharePoint layouts folder and register the CSS using the “Sapiens.at.SharePoint Script Loader” in the site settings.

Include “/_layouts/your-style-file.css”

Of course it’s also possible to add a content editor web part to the form or to any other page and insert the inline style to hide the actions and other sections you don’t want to display.

I hope you find this helpful.