Dec 03, 2015
In general, to manipulate a page’s behaviour in SharePoint you normally add a Content Editor web part to the page, and write appropriate JavaScript in it to accomplish the behaviour.
To further allow this behaviour to be exhibited only for some users you set the web part’s target audience to a group of users. Here, we learn how to achieve this. The behaviour we are concerned with here is hiding attachments from certain groups of users in DispForm.aspx, but of course, you can extend this to any other behaviour.
DispForm.aspx is the page that is called when you view properties of a list item. On this page you normally see data for each field.
If you don’t want to show a specific field, you can simply go to the Edit Page mode, insert a Content Editor web part to the page and then add an appropriate JavaScript to the web part to hide a row.
However, as mentioned before, you can write your own code to perform what you want (don’t forget to save the page).
If you now show the page in SharePoint you’ll notice that no one will be able to see attachments when they view the properties of a list item.
To hide it from only certain users, first create a Group that includes those users and then key in the name of the group in the Target Audience section of the Web Part. To get to the Target Audience section you need to be in Edit mode of the page. Show the Content Editor web parts’ Properties task pane and go to the bottom of Advanced section. There you’ll see the Target Audience.
If you'd like more information, take a look at New Horizons' SharePoint training courses.
How do your Excel skills stack up?
Test NowNext up:
- Combining different chart types in Excel 2013
- Intro and setup for Xbox SmartGlass
- My mate Stevo said it was good and Norm just couldn’t wait his turn!
- Difference between ByVal and ByRef in VBA
- Fiddly actions with Word tables
- Windows as a Service – The new Update Model
- A Recipe for Frame Fun with InDesign CC
- Word 2013 easy customisations
- Collaborative Hiring
- SharePoint 2016 – Quick facts
Previously
- Embedding Organisational Values into Performance Management
- Using the Fluent API with Entity Framework
- Custom Data Validation Rules in Excel
- Using a Calendar on your Website
- Ever typed a date into Excel and it turned into a number?
- What is ITIL?
- The best features of Excel 2013 – Part 1
- Why effective leadership is like yogurt
- AngularJS Service – The Basics
- The Quick Brown Fox…