Hot answers tagged term
2
Unfortunately you cannot filter the managed metadata for the parent and also return child terms when creating a view.
An alternative is to turn on metadata navigation. This would give you a navigation control on the left hand side of the page to filter by fields. Clicking on a top level term here would also show all the items with sub terms.
This can be ...
1
I think this will give you what you are looking for...
// get the TaxonomyField from the Site Columns in the sitecollectionTaxonomyField
field = (TaxonomyField)site.RootWeb.Fields[TAXONOMYFIELDID];
// get the Term Store ID from the field
Guid termStoreId = field.SspId;
// Open a taxonomysession and get the correct termstoreTaxonomy
Session session = new ...
1
So, this is my own approach, it is iterating the site collections, but not their contents. It just checks the TaxonomyHiddenList for the terms it contains.
But if someone has a better idea, I would happily accept it :)
$usedTerms = @{}
Get-SPSite -Limit All | foreach {
$web = $_.OpenWeb()
$list = $web.Lists | where { $_.Title -eq ...
1
Yes, that is the simplest way to do it. I have only found two ways to rename a term programmatically:
1) Set the Name property and CommitAll on the Term Store:
var site = SPContext.Current.Site;
var taxonomySession = new TaxonomySession(site);
var termStore = taxonomySession.TermStores[0];
var termGroup = termStore.Groups[0];
var ...
Only top voted, non community-wiki answers of a minimum length are eligible