Audience targeting in SharePoint 2010 is one of the significant features of SharePoint 2010 that helps target groups and individuals with specific pages, Web Parts, and content.
With the help of audience targeting feature, content can be targeted in a site for viewing by one or more specific audiences. SharePoint 2010 supports targeting using rules-based audiences(Global Audience), SharePoint groups, and distribution-list memberships. In addition, SharePoint 2010 provides the ability to target any list item, not just the lists. This means that virtually any individual item within the site – documents, events, custom list items, and even entire sites – may now be targeted to specific audiences.
A service which determines Target Audience should be enabled and running. It’s SharePoint User Profile Service that depends on “User Profile Synchronization Service”. So first check the Services via Central Administration -> System Settings -> Manage Services on server.
1. Check the status of “User Profile Service” and “User Profile Synchronization Service”
2. Check the SharePoint Server Search Service status. ( It must be started )
3. Click “User Profile Service Application” link. It’ll open the user profile service application settings. Select Configure Syncrhronization Connections and create new connection if required. (If you’ve created new connection then open “Configure Synchronization Timer Job” and run it now.)
Enable Audience Targeting for Site Collection
Log in SharePoint site with the administrator.
Go to Site Settings>Site Collection features, start the “SharePoint Server Publishing Infrastructure” feature, then go to “Site collection navigation” to check if “Enable audience targeting” is selected.
Once “SharePoint Server Publishing Infrastructure Feature” has been activated, the “Content Query Web Part” appreas on the Add Web Part List.
Audience Targeting supports three type of groups: Global Audiences, Distribution/Security Group and SharePoint Groups.
1. Global Audience: Enterprise User Profile Service Application -> People -> Manage Audiences.
2. SharePoint Group: Go to Site Settings>Site Permission>Create Group
ENABLE AUDIENCE TARGETING ON THE LIST OR LIBRARY
Anyone with at least the Contribute permission level can target list or library items to specific audiences. To set the target audiences for an item, just edit the item’s properties and then enter the audience names in the Target Audiences field. The targeted list or library item will only appear to the targeted audiences.
The GUID of this target audience field is “61cbb965-1e04-4273-b658-eedaa662f48d”.
NOTE If the SharePoint list or library already is enabled for audience targeting, the Target Audiences column appears.
- Click the list or library that contains the item you want to target.
- On the list toolbar, click Settings, and then click List Settings or Document Library Settings.
- Under General Settings, click Audience targeting settings.
- Select the Enable audience targeting check box.
After you enable the list or library for audience targeting, you can set individual items in the list or library to be displayed to one or more audiences.
- Click the arrow next to the name of an item in the list or library, and then click Edit Properties.
- In the Target Audiences list, add one or more audiences.
NOTE If content approval or workflow is enabled on the list or library, the item may need to go through the approval process.
DISPLAY THE ITEM IN A WEB PART
To display the list or library item to a specific audience, you can use the Content Query Web Part. The Content Query Web Part allows you to build a query that can filter list and library items.
- On the page where you want to display the item, on the menu, click Edit Page.
- Click Add a Web Part, and then under Default, click Content Query Web Part.
- Click Add.
- Click Edit and then click Modify Shared Web Part to open the tool pane for the Web Part.
- In the tool pane, under Query, click Show items from the following list and then specify the location of the list.
- Under List Type, choose the type of list that the item is a member of. In this example, click Document Library. Only items in the list type that you choose are processed by the query.
- Under Audience Targeting, do the following.
|Display the list items to the target audience that you specified in Step 2: Specify the target audience on the items, when the current user is a member of the audience.||Select the Apply Audience Filtering check box. This is required for the query to work properly.|
|Also display the items in the list that do not have a target audience specified. These items are displayed to everyone.||Select the Include items that are not targeted check box. This is optional.|
When the page is rendered, the content in the Web Part appears only to current users who are members of the audiences you specified.
NOTE As with all Web Parts, the Content Query Web Part has a Target Audiences list in the Advanced section of the tool pane. This setting determines whether the Web Part itself is visible to the current user. If not, none of the other settings apply.
Display Multiple Columns on the Web part
The Content Query Web part cannot fetch data across site collections.
Go to the XSL Style Sheets under the Style Library, the CQWP uses 2 important stylesheets :
Download this file and customize it to make the web part display multiple columns of a list.
- Add the following to the top of the file
- Create a new template to display multiple columns
<xsl:template name=”PamStyle” match=”Row[@Style=’PamStyle’]” mode=”itemstyle”>
*Upload ItemStyle.xsl to Style Library and publish a major version; otherwise, only the admin can see the new results.
- Once the new version of ItemStyle has been published, you can see the changes under “Presentation” when you edit web part:
Target a navigation link to an audience
A navigation link on a server running Microsoft Office SharePoint Server 2007 can be targeted so that it appears only to people who are members of a particular group or audience. You need to have at least Design permission in order to modify the site navigation settings.
- On the Web page that contains the site navigation, on the menu, click Site Settings and then click Modify Navigation.
- On the Site Navigation Settings page, click
- In the Navigation Link dialog box, type the title and URL of the link, and then add one or more audience names to the Audiences list.
When the page is rendered, the navigation link appears only to the people who are members of the audiences you specified.
Target a Web Part to an audience
Microsoft Office SharePoint Server 2007 Web Parts can be targeted to appear only to people who are members of a particular group or audience.
An audience can be identified by using a SharePoint group, a distribution list, a security group, or a global audience.
- On the Web page that contains the Web Part, on the menu, click Edit Page.
- On the Web Part, click the Web Part menu , and then click Modify Shared Web Part.
- Under Advanced, add one or more audience names to the Target Audiences list.