A nice feature in SharePoint Server 2010 is the ability to provide list and document library navigation/filtering through metadata and content type association. In a nutshell, this provides the ability to switch on features in the SharePoint user interface that allow users to find information by filtering and navigating using metadata tags and content types as opposed to folders, which as we all know have their limitations. Further details on the feature can be found here.
The feature is configured in the user interface by selecting “Metadata navigation settings” from the list settings. This will display an administration interface similar to the one shown below:
As you can see from the screenshot above, I have two custom columns called Document Status (single-value Choice type) and Technology (single-value Managed Metadata type) available in the Available Hierarchy Fields and Available Key Filter Fields boxes ready to add as a navigation hierarchy or key filter. Note the default setting for Selected Hierarchy Fields is Folders.
For this example, I will use PowerShell to configure both the navigation hierarchy and key filters settings to include my custom columns. I will also show you how to add the Content Type and Folders options too.
First, we will assign the site that contains the list to a variable and use this variable to get the list:
#Get Web and List objects
$web = Get-SPWeb http://portal/permuniquesite
$list = $web.Lists["Shared Documents"]
Next, we will get the current metadata navigation settings for the list and assign them to a variable:
#Get metadata navigation settings for the list
$listNavSettings = [Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationSettings]::GetMetadataNavigationSettings($list)
The next two lines of the script clear the configured hierarchies and configured key filters on the list. You could use these commands in combination with the SetMetadataNavigationSettings and $list.RootFolder.Update() commands mentioned later to remove any currently configured metadata navigation settings for the list:
#Clear current metadata navigation settings on the list
$listNavSettings.ClearConfiguredHierarchies()
$listNavSettings.ClearConfiguredKeyFilters()
These commands will add my two custom columns to the Selected Key Filter Fields:
#Configure key filters by adding columns
$listNavSettings.AddConfiguredKeyFilter($list.Fields["Technology"])
$listNavSettings.AddConfiguredKeyFilter($list.Fields["Document Status"])
These next two lines are quite important. I have found that the navigation hierarchy configuration does not work when configuring it from PowerShell unless you add the default Folders item to the Selected Hierarchy Fields first. Without this step, the custom columns will be added successfully in the Metadata navigation settings page, but they will not appear in the Tree View interface:
#Add folder navigation hierarchi$listes into list settings
#This is required to enable and show navigation hierarchies in the Tree View
$folderHierarchy = [Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationHierarchy]::CreateFolderHierarchy()
$listnavSettings.AddConfiguredHierarchy($folderHierarchy)
The next step is optional, but contains the commands needed to add Content Type navigation hierarchies to the settings, if required:
#Optionally add content type navigation hierarchies into list settings if required
$ctHierarchy = [Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationHierarchy]::CreateContentTypeHierarchy()
$listnavSettings.AddConfiguredHierarchy($ctHierarchy)
We now add the custom columns to the Selected Hierarchy Fields:
#Configure extra navigation hierarchies by adding list columns
$listNavSettings.AddConfiguredHierarchy($list.Fields["Technology"])
$listNavSettings.AddConfiguredHierarchy($list.Fields["Document Status"])
And finally, set the metadata navigation settings and update the root folder of the list, which is where the settings are stored:
#Set the new metadata navigation settings and update the root folder of the list
[Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationSettings]::SetMetadataNavigationSettings($list, $listNavSettings, $true)
$list.RootFolder.Update()
The Metadata navigation settings page should now look as follows:
To test the metadata navigation feature, you will need to switch on the Tree View setting for the site. This can be done in the UI by selecting Site Settings > Tree view > Enable Tree View or you can change it with a couple of extra lines in your PowerShell script:
#Enable Tree View on the site so that navigation hierarchies can be used in the UI
$web.TreeViewEnabled = $true
$web.Update()
The metadata navigation and key filters features will show up on the left-hand side of the SharePoint user interface, underneath the quick launch menu, as shown above. To complete the script, don’t forget to dispose of the Web object:
#Dispose of the Web object
$web.Dispose()
Hey Phil,
ReplyDeleteThis worked great for me, but a question. How can we add the "All Tags" column? I believe this represents the enterprise keywords field. This is treated like a special type like content type, but there's no special method for adding it. I tried all tags and enterprise keywords, and it didnt work. Ideas? The MetadataNavigationKeyFilter class says its there:
"If it is the special Enterprise Keywords field, then the filter will be an All Tags filter, which enables you to find items with the managed metadata term in any of the Managed Metadata fields in the item".
Thanks as always!
I dont think you need to update root folder.
ReplyDeleteI can not get this to work properly. Using the code above, I am able to add all the correct settings to the list, however the navigation controls only flash for a fraction of a second when the page loads, and then they disapear again.
ReplyDeleteIf I then go into the metadata navigation settings for the list, all the correct settings are there, and when I press "ok" and go back to the list, everything is working as intended. How can I add the "OK" part into the script?
I figured out what was causing this behaviour. I was clearing the configured hierarchies and key filters and not updating it before adding the new fields. What I had to do instead was to first clear previous filters, then update the navigation settings, and then fetch a new $listNavSettings object, add the new filters, and call update again:
Deletefirst:
$listNavSettings = [Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationSettings]::GetMetadataNavigationSettings($list)
$listNavSettings.ClearConfiguredHierarchies()
$listNavSettings.ClearConfiguredKeyFilters()
[Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationSettings]::SetMetadataNavigationSettings($list, $listNavSettings, $true)
$list.RootFolder.Update()
$listNavSettings = [Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationSettings]::GetMetadataNavigationSettings($list)
$listNavSettings.AddConfiguredHierarchy($myField)
$listNavSettings.AddConfiguredKeyFilter($myField)
[Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationSettings]::SetMetadataNavigationSettings($list, $listNavSettings, $true)
$list.RootFolder.Update()
My previous post wasnt entierly true, after further investigation. In my case I had a different problem, where the key filters and hierarchies would flash for a fraction of a second and then dissapear. All the settings were correct, and even if I did the settings manually through the the sharepoint GUI, it still didnt work.
DeleteSo the problem was in the custom list view that the document library was using. Im not sure how or why, but inserting some markup fixed my problem, using this blog: http://tihomirignatov.blogspot.no/2010/08/how-to-use-metadata-navigation-in.html
I noticed something interesting when investigating this too. The URL to the view (http://server/web/list/Forms/dokumenter.aspx?woid=1&NavIndex=1 &HideFolderView=true&RootFolder=/site/web/list/1/Dokumenter&Source=1) contains an argument "HideFolderView=true". If I manually changed said argument to "false" instead, then the key filters and hierarchies would show as expected. Just saying.
2015-12-7 xiaozhengm
ReplyDeleteadidas uk
nike free run
toms outlet
ugg outlet
michael kors outlet online
nike huarache trainers
polo ralph lauren
jordan 8
michael kors handbags
christian louboutin uk
running shoes
cheap uggs boots
air force 1
ralph lauren outlet
coach outlet
michael kors outlet
toms outlet
hermes uk
michael kors uk
ugg boots
fitflops clearance
michael kors uk
tory burch outlet
oakley sunglasses
nike outlet
louis vuitton outlet
louis vuitton pas cher
kate spade outlet
gucci outlet
coach outlet
michael kors outlet
canada goose uk
coach factory outlet
christian louboutin shoes
nike blazer
jordan 8s
michael kors handbags
jordan 3 infrared
caoch outlet
true religion outlet
Great Article..
ReplyDeleteOnline DotNet Training
.Net Online Training
Dot Net Training in Chennai
IT Training in Chennai
Great Article..
ReplyDeleteOnline DotNet Training
.Net Online Training
Dot Net Training in Chennai
IT Training in Chennai
louis vuitton outlet
ReplyDeletecoach outlet
kevin durant shoes 8
gucci outlet
louis vuitton
true religion jeans
louis vuitton uk
polo ralph lauren
louis vuitton
louis vuitton outlet stores
oakley sunglasses
coach outlet
ray ban sunglasses
coach outlet
kobe shoes 11
jordan retro 3
rolex submariner
mont blanc pens
michael kors outlet clearance
michael kors outlet online
michael kors outlet
toms shoes outlet
louis vuitton
michael kors outlet
michael kors outlet
toms shoes
louis vuitton handbags
mont blanc
christian louboutin outlet
michael kors outlet clearance
polo ralph lauren
polo ralph shirts
cheap jordans
longchamp handbags
tory burch outlet
jordan concords
cheap jordans
coach outlet online
coach canada
christian louboutin sale
20168.8wengdongdong
uggs on sale
ReplyDeleteinstyler max
louis vuitton outlet
ralph lauren outlet
canada goose femme
lunettes ray-ban
gucci belts
ugg outlet online
canada goose jackets
oakley vault
20169.27chenjinyan
ugg boots
ReplyDeletecoach outlet
fitflops sale
celine outlet
beats by dr dre
jordan shoes
nike trainers
michael kors handbags
nike free run
chrome hearts
chanyuan1011
ray ban glasses
ReplyDeletegucci outlet online
canada goose femme
canada goose outlet online
michael kors outlet online
uggs sale
michael kors handbags clearance
louboutin outlet
tiffany and co jewelry
uggs on sale
2016.11.26xukaimin
ray ban glasses
ReplyDeletegucci outlet online
canada goose femme
canada goose outlet online
michael kors outlet online
uggs sale
michael kors handbags clearance
louboutin outlet
tiffany and co jewelry
uggs on sale
2016.11.26xukaimin
cheap uggs
ReplyDeletefitflops sale clearance
tiffany outlet
michael kors outlet
fitflops uk
jordan pas cher
the north face jackets
coach outlet online
ugg outlet
michael kors outlet online
20161130caihuali
hxy2.14
ReplyDeletetoms outlet
toms shoes
toms outlet
toms shoes
toms outlet
toms shoes
toms outlet
toms shoes
toms outlet
toms shoes
coach outlet
ReplyDeletetrue religion
coach outlet
timberland outlet
coach factory outlet
cheap rolex watches
kobe shoes
celine outlet
coach canada
giuseppe zanotti
20173.9chenjinyan
by: alat bantu sex termurah
ReplyDeleteHello sir, after I read the article you get to the bottom, It is very interesting to look at, it can provide benefits, and also the lessons, I really like it.
so that I can remember with this master page and be back here, I leave a trail so that I could track my trail I have ever visit
alat bantu sex pria
alat bantu sex wanita
I apologize if I trace unfavorable.
michael kors wallets for women
ReplyDeleteralph lauren
true religion jeans
rolex watches
coach handbags
cheap oakley sunglasses
coach factory outlet
kd shoes
bottega veneta outlet
ray ban sunglasses
20170323lck
[url=http://www.yeezyboost-350.us.com][b]adidas yeezy boost 350[/b][/url]
ReplyDelete[url=http://www.coachfactory-outletonlines.us.com][b]coach outlet online[/b][/url]
[url=http://www.moncler-outlet.us.com][b]moncler jackets[/b][/url]
[url=http://www.adadasstansmith.com][b]stan smith adidas[/b][/url]
[url=http://www.adidastrainersuk.org.uk][b]adidas uk[/b][/url]
[url=http://www.tomsshoesoutlet.in.net][b]toms outlet[/b][/url]
[url=http://www.pandoracharmssaleclearance.me.uk][b]pandora charms sale clearance[/b][/url]
[url=http://www.michaelkorsoutletclearance.com.co][b]michael kors outlet clearance[/b][/url]
[url=http://www.coachoutletstore-online.us.com][b]coach outlet store online[/b][/url]
[url=http://www.abercrombieandfitch.in.net][b]bercrombie[/b][/url]
0323shizhong
longchamp sale
ReplyDeleteadidas uk
coach outlet store
nike air max
yeezy boost 350
rolex replica watches for sale
coach factory outlet online
yeezy shoes
michael kors
phillies jerseys
0323shizhong
20170327 junda
ReplyDeletelouis vuitton outlet
cheap ray ban sunglasses
michael kors handbags outlet
coach outlet online coach factory outlet
christian louboutin shoes
ysl outlet
oakley sunglasses wholesale
hermes belt
ferragamo shoes
louis vuitton handbags
cheap oakley sunglasses
ReplyDeleteoakley sunglasses
christian louboutin heels
oakley sunglasses outlet
coach outlet online
oakley vault
nike air max uk
oakley sunglasses cheap
nike air max
valentino heels
hzx20170415
Audemars Pigeut replica
ReplyDeletevery good watches
hello!!
mbt outlet
ReplyDeletecoach outlet online
fitflops sale
ray ban outlet
pandora jewelry outlet
nike running uk
nike huarache women
ralph lauren outlet
true religion sale
hermes belt
2017.5.15chenlixiang
nike outlet online
ReplyDeletetory burch outlet online
fred perry polo shirts
yeezy boost
nike air max 95
coach outlet
christian louboutin outlet
ray ban sunglasses outlet
true religion jeans outlet
yeezy shoes
170517yueqin
giuseppe zanotti outlet
ReplyDeleteralph lauren polo
oakley sunglasses wholesale
ralph lauren outlet
ray ban sunglasses outlet
valentino outlet
coach outlet
wanglili21070524
oakley sunglasses wholesale
ReplyDeletenike air max 1
michael kors outlet stores
michael kors outlet
adidas nmd runner
michael kors handbags
cheap oakley sunglasses
louis vuitton
coach outlet online
true religion jeans
chanyuan2017.06.08
Nece information ;)
ReplyDeleteObat Membersihkan Flek Paru Paru
Cara untuk Mengobati Bronkitis Kronis
Pengobatan Untuk Glaukoma
Cara Atasi Dan Pengobatan Ginjal Bocor
Pengobatan Atasi Patah Tulang
Cara untuk Menangani Luka
given article is very helpful and very useful for my admin, and pardon me permission to share articles here hopefully helped :
ReplyDeleteSuplemen untuk mengatasi nafsu makan anak yang hilang
Obat testis bengkak ampuh
Cara menyembuhkan penyakit katup jantung
pandora charms
ReplyDeletered bottoms louboutin
kobe 12
north face uk
valentino outlet
red bottom shoes}
nike factory
fitflop
cheap soccer cleats
supreme hoodie
1、
ReplyDeletecheap jordan shoes
golden goose sneakers
golden goose
fitflops clearance
coach outlet
basketball shoes
cheap jordans
reebok outlet store
cheap basketball shoes
cheap air jordans
A declaring the particular estimate, You are investing buy regarding items from owner if you're the back again prospective buyer. You have read carefully and accepted the world shipping and delivery tool requisites frees in a totally new windowpane quite possibly bill. Significance costs before cited may very well be short sale change even ought to ones optimal buy quantity..
ReplyDeleteDue to sending in Camisetas De Futbol Baratas some Coach Outlet Online Store bet, You are investing in buy this advice supplement from the owner if you're equipement foot the Maillot De Foot Pas Cher back again prospective buyer. resultados de futbol You read and accept to the world transporting show t's and c's starts up in a replacement window case npotentially loss. Transfer penalty service fees in the offered might be controlled Maglie Poco Prezzo by change circumstance you heighten you the highest level of wager helping..
These volume entails pertinent practices jobs, Levy, Stock dfb trikot müller broker effectively payments. This is what level is be governed by change unless you want to make agreed paying. The local surf forecast in an european union part lay claim more significant usa, Significance calendario de futbol tax manuel neuer trikot rot to this own not maillot foot 2018 really recoverable.
I like your topic of selection for blog but want to suggest you for sharing some more information regarding your subject so that we can understand your thought more clearly
ReplyDeletehooda games
Check getting the money for exchanges should be possible effectively and naturally without a clerk through check liquidating machines. These machines are found in numerous areas, for example, comfort stores and banks and can frequently be gotten to 24 hours every day. car title loans online chicago
ReplyDeletethank you information, very helpful, do not forget to visit also kunju our page to berai information about health
ReplyDeleteobat kesrek di selangkangan
Cara Mengobati Tukak Lambung
cara menghilangkan budug
Obat Luka Lebam
maillot de foot pas cher
Deletemaillot paris 2018
maillot de foot pas cher
Maillot Foot Pas Cher
maillot foot pas cher
maillot psg pas cher
maillot de foot pas cher
louboutin pas cher
louboutin soldes
His article is very helpful at all thanks
ReplyDeleteObat Penyakit Asam Urat
Obat Mata Juling
Obat Kanker Rahim
Obat Gatal di Ketiak
Cara Mengobati Sakit Pinggang
Cara Mengobati Benjolan Di Vagina
may be useful for all, helpful article once and pardon me permission to share also here :
ReplyDeleteCara mengobati tukak lambung
Cara mengatasi luka lambung
Obat prostat bengkak ampuh
Suplemen untuk mengencangkan kulit wajah
Obat tenggorokan kering
Obat hidrokel ampuh
Obat vertigo
It is a time consuming process to locate a legitimate, high-quality designer Michael Kors Handbags On Sale at a decent price. One brand name that is sought after is the Michael Kors Bags On Sale. Anywhere you see high demand you will find people out to make a quick buck.
ReplyDeleteThere are those who want to collect vintage items like Michael Kors Factory Outlet with genuine and high quality leathers from Michael Kors. To be able to grab a quality Michael Kors Bags Outlet item of your choice, make sure to be very careful in selecting what to buy, how to buy and where to buy the Michael Kors Outlet Online.
ReplyDeletethank you very useful information admin, and pardon me permission to share articles here may help :
ReplyDeleteCara mengatasi mata cepat lelah
Obat pengapuran tulang ampuh
Obat pelangsing perut yang ampuh
Obat batu empedu tanpa operasi
Obat penebalan dinding rahim ampuh
Cara menyembuhkan insomnia akut
Cara mengatasi rabun senja
thank you very useful information admin, and pardon me permission to share articles here may help Cara menyembuhkan penyakit gondok
ReplyDeleteNumpang share Obat Nyeri Punggung and Obat Herpes thanks for permission and I hope this can be usefull for every one
ReplyDeleteDesigner Exposure es un buen lugar para comprar su Bolsos Michael Kors original.
ReplyDeleteThe Woven Tote es también una selección impresionante en el Bolsos Michael Kors Baratos.
Bolso de alta calidad que debe contemplar absolutamente un Bolsos Michael Kors Outlet.
Du kommer att upptäcka en handfull detaljer som du kan förvänta dig att komma över på en vanlig Michael Kors Rea.
Du kan hitta ett antal platser som ger Väska Michael Kors.
Sortimentet är fantastiskt för alla som letar efter en MK Väska.
Håll dina ögon öppna för den här säsongens val som kommer att presenteras under bara några månader och det kommer utan tvekan att bli spektakulärt.
Given article is very helpful and very useful for my admin, and pardon me permission to share articles here hopefully helped :
ReplyDeleteObat dompo
Obat kutil kelamin pria
Obat radang amandel tanpa operasi
Obat radang tenggorokan pada bayi
Obat benjolan di kepala
Obat pengapuran tulang lutut
Obat kencing berdarah
Shared this Obat benjolan di kaki kanan dan kiri young Biaya operasi lambung bocor dan pengobatan alternatif meaning Obat hidung tersumbat dan bersin bersin yang tidak kunjung sembuh fallin Obat benjolan di tangan kiri dan kanan howdy Obat benjolan di penis ubay Obat sakit kepala karena asam lambung naik howdy Obat gatal di selangkangan dan bokong atau pantat tone Obat sakit pinggang belakang bawah right Obat kalazion di kelopak mata atas dan bawah here Obat ganglion di tangan Thanks...
ReplyDeletemaillot foot pas cher
ReplyDeletemaillot pas cher
maillot psg pas cher
maillot equipe de france pas cher
maillot de foot pas cher 2018
ensemble de foot pas cher
maillot de foot pas cher
ensemble de foot pas cher
maillot de foot pas cher
maillot foot pas cher
maillot pas cher
maillot psg pas cher
maillot equipe de france pas cher
maillot de foot pas cher 2018
maillot equipe de france pas cher
maillot de foot pas cher 2018
ensemble de foot pas cher
maillot de foot pas cher
maillot foot pas cher
maillot pas cher
maillot psg pas cher
camisetas de futbol
ReplyDeletecamisetas de futbol baratas
camisetas futbol baratas
camiseta real madrid barata
equipaciones de futbol baratas
comprar camisetas de futbol
camisetas de futbol baratas 2017
comprar camisetas de futbol
tiendas de futbol
camisetas de futbol
camisetas futbol baratas
camisetas futbol
camiseta real madrid barata
bounty camisetas futbol
camisetas de futbol 2018
maglie calcio a poco prezzo
ReplyDeletemaglie calcio poco prezzo
maglie calcio 2018
maglie italia
maglie calcio a poco prezzo
maglie calcio poco prezzo
maglie calcio 2018
maglie italia
maglie calcio a poco prezzo
maglie calcio poco prezzo
maglie calcio 2018
maglie italia
maglie calcio a poco prezzo
maglie calcio poco prezzo
maglie calcio 2018
maglie italia
maglie calcio a poco prezzo 2018
maglie calcio poco prezzo 2018
camisetas de futbol
ReplyDeletecamisetas de futbol baratas
camisetas futbol baratas
camiseta real madrid barata
equipaciones de futbol baratas
comprar camisetas de futbol
camisetas de futbol baratas 2017
comprar camisetas de futbol
tiendas de futbol
camisetas de futbol
camisetas futbol baratas
camisetas futbol
camiseta real madrid barata
bounty camisetas futbol
camisetas de futbol 2018
Everything I saw in you, as I once thought of my old lover who had stopped in my love affair
ReplyDeleteObat Hematuria
Cara Melancarkan Haid
Cara Menyembuhkan Pilek Menahun
Pengobatan Tipes Pada Anak
Obat Diabetes Paling Ampuh
Thanks for provide great informatic and looking beautiful blog, really nice required information & the things i never imagined and i would request, wright more blog and blog post like that for us. Thanks you once agian
ReplyDeleteBirth certificate in delhi
Birth certificate in ghaziabad
Birth certificate in gurgaon
Birth certificate in noida
How to get birth certificate in ghaziabad
how to get birth certificate in delhi
birth certificate agent in delhi
how to download birth certificate
birth certificate in greater noida
birth certificate agent in delhi
Birth certificate delhi
Both things are possible if you carry Michael Kors Handbags Wholesale. If you are a woman who goes for innovative designs, a designer Michael Kors Bags On Sale is perfect for you. Offering a huge selection of chic purses, handbags, shoes and accessories, Michael Kors Outlet Online Store celebrates womanhood in an entirely unique way. Michael Kors Factory Outlet Online Store At Wholesale Price are one of the most sought-after handbags worldwide. We all agree that diamonds are a woman's best friend; however Official Coach Factory Outlet Online are absolutely next in line. To Coach Outlet Sale aficionados, don't fret because we have great news: a discount Official Coach Outlet Online isn't hard to find. If you are a smart shopper looking for a good buy and great deals on your next handbag purchase, you can go to Official Coach Outlet Online.
ReplyDeleteFriendly Links: Toms Shoes Womens | Toms Clearance