Sharepoint Metadata Filter Page

SharePoint Metadata: Filter Page Web Parts | David Lozzi’s Blog

Tuesday, August 30, 2016

12:11 PM

From: https://davidlozzi.com/2012/02/20/sharepoint-metadata-filter-page-web-parts/

On my list of awesome SharePoint ideas that I want to try and do, was giving users the ability to filter a page based on selected metadata.  I decided to hurry up and do it thanks to a question on MSDN forums. Special thanks to Stefan Bauer for the starting of some great code!

I’ve created a CodePlex project which contains the code file, check it out at SharePoint Filter Page by Metadata. Very simply, users can click from a list of terms within a term set, and filter all web parts on the page.

vewn•op 
dewpeoz 
aoueuRA09 
ssausng 
u.wpv 
u.wpv 
Kg paypon 
u!l.upv 
wno:03V u!wpv 
paypon 
sz:ot zt0Z/0Z,'Z 
sz:or ztoz/oz/z 
sz:ol Zloz/oz/z 
pa '"pon 
tz:oi Zioz/oz/z 
Zloz/oz/z 
sz:ot ztcz/0Z,'Z 
aweN 
adÅI 
1 e Oen 
nueuu 
e6ed 
s6u!aaaLA' pueoa 
wawroop 
euRft09 
adÅI Q 
suodöY 
vawn•op 
eN adAl 
suetunN0 peleqs 
sauewnooa

Documents 
Shared Documents 
Z] Type 
Name 
Modified 
IV Modified ay 
There are no items to shon in this Vien of the Shared Documents' document library. To add a nevv item, dick 
or upload'. 
Add document 
Filter Page 
Dept 
Finance 
Legal 
Risk 
Tech 
Reports 
Z] Type 
Name 
Gove r na nce 
Modified 
2/20/2012 10:24 AM 
Add document 
Board Meetings 
Z] Type 
Name 
Susiness Requirements 
# Add document 
Modified 
2/20/2012 10:25 AM 
Modified ay 
Admin Account 
Modified ay 
Admin Account

Prerequisites

  • Metadata service application is running, and has a term set.

  • Use a managed metadata site column (created in the root web) in each list/library containing the term set.

  • All web parts on the page this is installed in has to use the same site column.

To use this script:

  • Download FilterPagebyMetadata.txt from CodePlex.

  • If your SharePoint site doesn’t have them already, download SPServices and jQuery and upload to SharePoint. I use the Site Assets folder in the root web, but you can pick anywhere you want.

  • Open the FilterPagebyMetadata.txt in NotePad.

  • Update lines 13 and 14 to point to your files from above.

  • Update line 17 to your managed metadata site column name.

  • Save the file.

  • Upload to your SharePoint site. Again, I prefer to use the Site Assets folder in the root site.

  • Browse to your page where you want to use the code.

  • Insert a new Content Editor Web Part.

  • Edit the web part and specify the Content Link value as the path to the FilterPagebyMetadata.txt file, i.e. /SiteAssets/FilterPagebyMetadata.txt.

  • Click OK and save the page.

TADA! You’ll see the list of values from the metadata service, and when clicked, it’ll filter your page!

NOTE There is currently one issue however, and I’m not sure if we can get around it. If you include a web part to a list that does not have the same site column in it, that web part will error when filtering the page.

Announcements 
One or more field types are not installed properly. Go to 
the list settings page to delete these fields. 
correlation ID:961e4b16-2e7c-436c-92b6-76372201d74f

admin_wiki_imrd has written 10 articles