This aritcle is similar to SharePoint: Add a custom sort order to a Links List, which demonstrates how to do a custom grouping and sorting uses just a single additional metadata column. In this article, I'll demonstrate using two new columns, one for grouping and the other for custom sorting.Given this, I'll skip the intro's and get right to the point. (No I won't, but it seemed like the right thing to do.)
A SharePoint Links list allows you to create a simple list of links to other portals, external webpages, fileshare folders, or anything else that can have a link. Links list are one of the most simple of the standard, out-of-the-box SharePoint lists. You get a URL field, which has the URL and a display name, and then some other fields that never get used, like the notes column. My objective in SharePoint is always to squeeze a little more functionality out of the pre-canned features, and this article will show you that we can get even more juice by adding a 2nd custom column, the first was the custom sort in the first article, and the 2nd will be a category field to take advantage of grouping within a List View.
To create the category metadata column, go to the list settings and then click the Add Column link below the list of existing column names. Using the pic (right) as a guide, make the following selections:
- Name = Category. The most important thing about this name is that it is the name that gets displayed in the webpart. So, if you make it too short, it may be confusing, and make it too long and it just junks up the display. (See the pic above for reference.)
- Data Type = Choice: Making this a choice column just makes data entry easier, but you want be flogged too badly for having this as Text, then later changing it to Choice. (It self populates the choices when you do this, fyi.)
- Choices - Enter your desired choices. Check for spelling.
- Display - Drop-down work really well, but try the others as needed.
- Allow Fill In - I don't like giving people the ability to misspeel things, so I mark the No.
- Default Value - Probably overkill, but set it to something for now.
Using the info from the previous article, referenced above, add a field for the custom sort order number field.
Next, you'll need to create a view that encompasses both the custom sort, and the group by Category. Using the pics (right) as a guide, create a view, and in the Sort section, do the following:
- Change the 'Allow users to order items...' to No
- Select the new field, SortNo, and then sort Ascending
- Select the URL field, and then sort Ascending
And in the Group By section (you have to expand it to see these options), do the following:
- Select the new Category column, leave it as ascending
- Set the Show Grouping to expanded. (Unless you have a wealth of groups and the user is ok with have to open them. Most don't.)
Save the view and test to verify your effort.
Once you get this view setup, you can either use it as is, or set it as the default for the webpart, and then your Links List will be the most awesome on the planet.
Veelead on May 12, 2020:
Thanks for Sharing informative
Nathan on June 29, 2017:
Yes! Editing the Links Web Part, by changing the view worked. Thanks for the tip, very helpful.
Steve Clark (author) from Northern, VA on June 29, 2017:
I don't know what is meant by, "copy over to the sharepoint page that the links list is a part of." but I'll guess that you have a webpart with a view. Well, webparts don't auto-update, you have to manually change them by updating it with the new instance of an existing view, or build the view within the webpart.
Nathan on June 29, 2017:
I'm using SharePoint 365, and I sorted and categorized the links list as you described - that worked nicely in the links list; however, this did not copy over to the sharepoint page that the links list is a part of.