Quantcast
Channel: Nick Hurst – SharePoint and Nintex OOTB
Viewing all 44 articles
Browse latest View live

CSWP Sites Display Template

$
0
0

This is a downloadable display template that you install on your site collection to allow any Content Search Web Part (CSWP) to display sites, their icon and site description.  Also depending the type of site, other relevant information such as the number of Community site members, discussions, and replies are displayed.
cswp-disptemp-sites-1

Adding Sites Display Template to Site Collection

You must have manage hierarchy permissions or higher on the site collection home in order to upload new display templates.

1. Download and extract the 4 files from the zip file:
CustomSitesDispTemp.zip

Upload the CSS file and icons

2. Add the CSS file and Icons to the Style Library at the Site Collection top site.
cswp-disptemp-sites-2

3. If there are the green checked out icons next to the files, click the checkbox next to the 3 files, select the Files tab, and Check In the 3 files.
cswp-disptemp-sites-3

4. Select Major version if presented with an option, click OK.
cswp-disptemp-discussion-4

Upload the display template

5. Go to the Site Collection Site Settings, select the Master pages and page layouts option.
cswp-disptemp-discussion-5

6. Click on the Display Templates folder
cswp-disptemp-discussion-6

7. Click on the Content Web Parts folder
cswp-disptemp-discussion-7

8. Click on the Files tab, select Upload Document
cswp-disptemp-discussion-8

9. Click the Browse button
cswp-disptemp-discussion-9

10. Find and select the Item_custom_sites HTML file that you extracted in Step 1.
cswp-disptemp-sites-4

11. The file properties window should popup, the Content Type, Title, Description, etc should all be pre-filled so just select Save.
cswp-disptemp-sites-5

12. Click the checkbox next to the Item_custom_sites.html file, click on the File tab, Check In (if option if available), then Publish (if option is available).
cswp-disptemp-sites-6

Add and configure the CSWP on a page

13. Go to a page and edit the page, Insert a Content Rollup > Content Search Web Part onto the page.  Edit the web part.
cswp-disptemp-discussion-14

14. Click the Change query button.
cswp-disptemp-discussion-15

15. Click the Switch to Advanced Mode option.
cswp-disptemp-discussion-16

16. Edit the Query text, your query text could include the path to one or more sites, this would show all sites under the specified site or sites.  Append (contentclass=STS_Site OR contentclass=STS_Web) to show both subsites and site collection home sites (web).  You can also specify the type of sites using the WebTemplate property filter.
cswp-disptemp-sites-7

17. Click the Sorting tab, unfortunately you cannot sort by the SiteTitle by default.  You would need to go to Central Admin > Search Service Application > Search Schema, and make the SiteTitle sortable for the farm (requires a full crawl to take affect)

In the meantime you can sort by SiteNumFollowers, ViewsRecent and ViewsLifeTime, or if it’s a community site by the CommunityMembersCount Descending.  Click the OK button at the bottom to save your query.
cswp-disptemp-sites-8

18. Select how many items you want to display, select the Custom Sites Item display template, click OK to save the web part settings.
cswp-disptemp-sites-9

Your CSWP should now be displaying sites with the custom formatting and information depending on site type:
cswp-disptemp-sites-1


SharePoint Analytics via the CSWP

$
0
0

Using the Content Search Web Part (CSWP) you can get analytics for the number of the different type of items (Files, Events, Discussions, Tasks, Pages, etc) that are in your SharePoint Farm.  The one caveat is that CSWP only display items that haven’t been removed from search (Deleted or setting library/list to not appear in Search in advanced settings) and that you have access to.  So ideally you would want to be logged in as a site collection or farm administrator to get an accurate count.

How CSWP’s can display analytics

Just add a CSWP to any page, edit the web part, and click on the Change query button.

1. Customize the Query text to return a specified item type and optionally add a time frame.
2. Click the Test query button
3.  The Search Result Preview panel on the right of the screen will show the number of Relevant Results.
cswp-analytics-1

CSWP Query Text Examples

The following are some examples of CSWP Query text that return a specific item type.  The (Created>={Today-90}) filter is optional, it limits the results to only items created in the last 90 days.  The reason to do a time filter, is ultimately you probably want to know how much new content is being created, not how much old content there is.  Just run these CSWP queries every 3 months to compare the new item generation from quarter to quarter.

# of files in document libraries, created in last 90 days
cswp-analytics-2

# of xml files (InfoPath), created in last 90 days
cswp-analytics-3

# of pages, created in last 90 days

This excludes the “How to Use This Library” page which is automatically created in every new Site Pages library (and rarely if ever used).
cswp-analytics-4

# of tasks, created in last 90 days

Were using the ContentType as contentclass returns all the workflow tasks as well.
cswp-analytics-5

# of ‘Custom List’ app items, created in last 90 days
cswp-analytics-6

# of events (calendar), created in last 90 days
cswp-analytics-7

# of discussion board posts & replies, created in last 90 days
cswp-analytics-8

Additional contentclass query text examples

Issues: contentclass:STS_ListItem_IssueTracking
Announcements: contentclass:STS_ListItem_Announcements
Blog Post: contentclass:STS_ListItem_Posts
Links List: contentclass:STS_ListItem_Links
Promoted Links: contentclass:STS_ListItem_170

Tracking the Analytics over time

Unfortunately the CSWP doesn’t track all the items that get deleted out of SharePoint, this makes it difficult to get analytics for past periods.  Your three options would be:

A.  Find the total number of items:
ContentType=Task 
**Returns the total number of searchable tasks in SharePoint on the day the query is run.

B.  Query the total number of items created during a specific period:
ContentType=Task AND (Created>=1/1/2016 AND Created<4/1/2016)
**Returns the total number of searchable tasks in SharePoint created between January 1st and March 31st 2016.  The problem with this query is the number will go down over time as older tasks get deleted.

C. Query the total number of items during a recent period:
ContentType=Task AND (Created>={Today-90})
**Returns the total number of searchable tasks in SharePoint for the last 90 days, if you setup a recurring appt to re-run this query, you could then compare the amount of item creation over time.

 

CSWP Showing Personalized Results

$
0
0

Content Search Web Parts can show results specific for the current user.  The personalization options can be for the person’s organizational profile date (Department, Job Title, and Location) or self entered profile values (Interests, Skills or Ask me About). This functionality could be especially useful on a homepage if you want different departments or locations to see different data for example.

1A. Personalizing by Department, Job Title or Location

These three fields are usually populated by your organizational Active Directory and are usually not editable the end users:
cswp-personalization-1

All the departments, Job Title’s, and Locations for all the people in your organization should already be in your Organizational Term Store under ‘People’:
cswp-personalization-2

1B. Tagging your content with department/location/title

In this example we setup a CSWP to only show the current user announcements that have been tagged with their specific department (‘IT Department’ in my case).

1. Go to the list or library which you want to display personalized content, click on the List/Library tab and select List/Library Settings.
cswp-personalization-3

2. Under the Columns section, click on the Create Column option.
cswp-personalization-4

3. Enter a Column name, select the Managed Metadata type, Allow multiple values, and then expand the People term set and choose either Department, Job Title or Location, click the OK button to create the column.
cswp-personalization-6

4. You can now either create a new item on your list/library, or edit an existing item:
cswp-personalization-7

5.  You can specify a department by starting to type and selecting from the popup menu OR by clicking on the tag icon which will allow you to browse all the options.
cswp-personalization-8

6. You items should now have one or more departments selected.
cswp-personalization-9

 

1C. Configuring the CSWP to show Personalized Results

7. Add or Edit a Content Search Web Part on a page.

8.  Edit the web part, click the Change query button.
cswp-personalization-16

9. Configure your Query to return items from your desired list or library
cswp-personalization-19

10. Add a property filter for the owstaxidmetadataalltagsinfo property that contains a value that you entered on your list (IT Department in this example):
cswp-personalization-22

11. Test your query, the result preview should show any items that we tagged with that term (IT Department).
cswp-personalization-18

12. Replace the text value after owstaxidmetadataalltagsinfo: with {User.Department}, {User.SPS-JobTitle}, or {User.Location}.  You can now set the Sort order and then click the OK button to save your Query.
cswp-personalization-23

13. Select the max number of items to show, select the Item display template, and click OK to save the web part.
cswp-personalization-24

Completed Example

CSWP showing only the items where my department (IT Department) has been tagged:
cswp-personalization-25

2A. Personalizing by Skills, Interests or Ask me About

These three fields are optionally populated by your end users in their profile:
cswp-personalization-15

When someone enters a new skill, interest, or ask me about topic they are entered into the system as a new Keyword.

2B. Tagging your content with skills/interests/about

In this example we setup a CSWP to only show the current user announcements that have been tagged with one of the ‘Interests’ in their SharePoint profile.

1. Go to the list or library which you want to display personalized content, click on the List/Library tab and select List/Library Settings.
cswp-personalization-3

2. Under the Columns section, click on the Add from existing site columns option.
cswp-personalization-5

3.  Select the Enterprise Keywords column, click Add, then click the OK button to create the column on your list/library.
cswp-personalization-10

4. Click on the new Enterprise Keywords column.
cswp-personalization-11

5.  Rename the column to the type of keywords (Interests, Skills, etc) that you will be entering, enter a description of what you are looking for.  Click OK to save your changes.
cswp-personalization-12

6. You can now either create a new item on your list/library, or edit an existing item:
cswp-personalization-7

7.  You can specify a Keyword by starting to type and selecting the keyword the popup.  The item you select must be designated as a [Keywords] and not a metadata term from a different term store.
cswp-personalization-13

8.  Your item should now have 1 or more keywords specified.
cswp-personalization-14

2C. Configuring the CSWP to show Personalized Results

9. Add or Edit a Content Search Web Part on a page.

10.  Edit the web part, click the Change query button.
cswp-personalization-16

11. Configure your Query to return items from your desired list or library
cswp-personalization-19

12. Add a property filter for the owstaxidmetadataalltagsinfo property that contains a value that you entered on your list (‘Snowboarding’ in this example):
cswp-personalization-26

13. Test your query, the result preview should show any items that we tagged with the term (Snowboarding).
cswp-personalization-27

14. Since {User.SPS-Interests}, {User.SPS-Skills}, and {User.SPS-Responsibility} (Responsibility is what Ask me about is called) are all multi-value fields, we have to format the query as follows:
{|owstaxIdMetadataAllTagsInfo:{User.UserProfileValue}}
cswp-personalization-28

15. Once you are finished configuring the Query Text and Sort Order, click the OK button to save your Query.

16. Select the max number of items to show, select the Item display template, and click OK to save the web part.
cswp-personalization-24

Completed Example

CSWP showing only the items where one of my Interests (Snowboarding) has been tagged:
cswp-personalization-29

 

Creating an email alert link

$
0
0

Email alerts can be very useful for not just power users, but for site visitors as well.  Unfortunately the email alert option is either hidden in the ribbon or in the ellipses where many people will never see it.  To make the option more accessible, you can create a link on your homepage that allows users to setup an email alert for a desired list or library.

 

Creating the link

To create the link, you need to find the GUID for the list or library you want to setup the email alert for.  An easy way to find the GUID, is to go to the rating settings for that list or library.

1. Go to your desired list or library

2. Go to the list or library settings

3.  Scroll down the list/library settings page and click on the Rating settings option
email-alert-1

4.  At the very end of the ratings settings url, right after List= is the GUID.  Copy the entire URL for the Ratings Settings page including the GUID
email-alert-2

5. Replace the ‘RatingsSetting.aspx’ with ‘SubNew.aspx’ in your copied URL.  Your URL should look something like this:
https://<Farm Name>/sites/<Site Name>/_layouts/15/SubNew.aspx?List=%7B06cb6e98-864c-4871-ac4b-9e45e650f088%7D

6. In order to have the person return to the page they started, you will need to append ‘&source=/’ and the ‘page url’ where you are going to put this link at the end of your link:
https://<Farm Name>/sites/<Site Name>/_layouts/15/SubNew.aspx?List=%7B06cb6e98-864c-4871-ac4b-9e45e650f088%7D&source=/Home.aspx

So in that example above we are going to return the person to the Home.aspx page once they have created their email alert.

7.  Use either the Quick Links (o365 modern page) or Summary Links webpart (all other SharePoint pages) to create the link with an image.  Links with images are much more effective than just plain links.

8.  If you need an email icon, download this email icon (right-click on it and choose to save image:
email_icon

9. Your completed link should look like one of these two examples:
email-alert-3

 

 

Viewing all 44 articles
Browse latest View live