Hot answers tagged

12

You have to use NavigationTerm To Create Term set: NavigationTerm term2 = navTermSet.CreateTerm("Term 2", NavigationLinkType.FriendlyUrl, term2Guid); /// Verify that the NavigationTermSetView is being applied correctly. Assert.AreEqual(web.ServerRelativeUrl + "/term-2", term2.GetResolvedDisplayUrl(null).ToString()); In order to ...


8

@Ashish Patel answer does not actually work when i tried but i was able to figure it out a bit differently. Here is my version of the helper method based on example provided by code ninja blog, here: private List<Guid> GetTermsIds(SPListItem listItem, string fieldName) { var taxonomyField = listItem.Fields.GetFieldByInternalName(fieldName) as ...


7

This is how you do it TaxonomyFieldValueCollection tfvc = (list.Items[0]["Field Name"] as TaxonomyFieldValueCollection); var valuesList = (from v in tfvc select v.Label).ToList();


7

a- Add reference to "Microsoft.SharePoint.Taxonomy" assembly b- You need to register following Assembly in your Web Part <%@ Register TagPrefix="Taxonomy" Namespace="Microsoft.SharePoint.Taxonomy" Assembly="Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> c- You can use the control as following &...


7

SP.Taxonomy.TaxonomyFieldValue type exposes the following properties via SharePoint REST API: Label TermGuid WssId How to retrieve Taxonomy field values using SharePoint REST in JavaScript Assume Pages library contains: Category single valued taxonomy field Categories mutli-valued taxonomy field Then the following example demonstrates how to perform ...


6

My Managed Metadata Application Proxy was not a part of the default proxy group. After running the following command $session.TermStores.Count now returns 1! Yay! Set-SPMetadataServiceApplicationProxy -Identity "Metadata Service Application Proxy" -DefaultProxyGroup


6

The solution provided by Vadim above didn't work for me, although it did help me towards an answer. I achieved this in two parts - Via jQuery / DOM get the editable DIV (the one with ID = ContainerId + 'editableRegion') and set the text value of the term you want (note, I didn't find it necessary to set the GUID of the term as well, so just "Africa" in ...


5

There is no tool for this in the UI. It is pretty straightforward using the object model. I have seen code samples in C# that could be adapted to PowerShell. Alternatively you could try downloading the termset import/export tool from Codeplex.


5

You cannot completely match the broad feature set of Managed Metadata but you can accomplish a subset of it using the techniques that existed before Managed Metadata was introduced: Define Taxonomic Metadata – Create custom site lists to be used for the management of metadata attributes you want to surface as controlled vocabularies for your site users. ...


5

It is possible to accomplish with OOTB Metadata Navigation and Filtering Feature using Navigation hierarchies control. Navigation hierarchies control allows to select an item in a hierarchy for a managed metadata column with filter for single Term Term with descendant child terms Applying filter in Navigation hierarchies control corresponds to ...


5

In order to add term under a any parent term, you should be needing two things: The Term store ID and relevant Term set The Parent Term ID (to which the new child term will be added) The update code will be following: function execOperation() { //Current Context var context = SP.ClientContext.get_current(); //Current ...


5

I have blogged about it here: http://www.vrdmn.com/2012/12/working-with-taxonomy-and-javascript-in.html The code: $(document).ready(function(){ var scriptbase = _spPageContextInfo.webServerRelativeUrl + "_layouts/15/"; $.getScript(scriptbase + "SP.Runtime.js", function () { $.getScript(scriptbase + "SP.js", function(){ ...


4

You can define a column in a list of type 'Managed Metadata'. This column allows you to set a specific Term Set to use in this column. The TagCloud will not look at this field. Unfortunately it only uses 'I like it' and the tags on the pages (social tagging). As far as I know you have to build your own (or maybe someone did already).


4

In your example you are setting the value of the field, then overwriting it when your loop gets to the next keyword. Rather than calling managedField.SetFieldValue every time you should be collecting all your terms in some form of collection, then calling it with this overload : TaxonomyField.SetFieldValue for example var terms = new List<Term>()...


4

The advantage of multiple managed paths is it's a first piece of metadata you can have in your farm. It helps break sites out into logical trees even thought they all reside in the same farm. This becomes very beneficial if you organize your structure very flat (many site collection) Based on the managed paths, you can have different SLAs for things ...


4

The Country column has to be updated in this form: <WssId>;#<Label>|<TermGuid> and the linked, hidden text field has to be updated with <Label>|<TermGuid> <WssId> should be an index in the TaxonomyHiddenList if the term exists in that list, but passing -1 seems to work too. This works on the SP2013 version of Office365, ...


4

Every time you use expensive operation to get data on public site, you should definitely go for caching. There is no difference between query to DB or using term store in Sharepoint. If you feel this operation is called often (each page load) and is expensive you should cache. There is quite a big chance that terms will not be changed very often, so you ...


4

You should check more carefully what you are doing in the code. For example in the line TaxonomyField taxField = (TaxonomyField)item["Dept"]; you are trying to cast TaxonomyFieldValue object to TaxonomyField, which is incorrect, so you get ArgumentNullException on the next line because taxField becomes null. And you are resetting item field value for ...


4

You can set a MultiValue Managed Metadata field by creating a TaxonomyFieldValueCollection and add this collection to the field by using the SetFieldValue method. First get the managed metadata field A possible way ( there are more ways ) to do this is to get the field by id $field = $item.Fields | ? {$_.Id -eq $fieldId} $tf = [Microsoft.SharePoint....


4

This method getTermSetsByName returns a collection of termsets, not a single termset, so you should probably do something like: var clientContext = new SP.ClientContext.get_current(); var tSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(clientContext); var ts = tSession.getDefaultSiteCollectionTermStore(); var tset = ts.getTermSetsByName("myTermSet"...


4

Enterprise Keywords is just a fancy name for a special term field that you can easily enable on lists, so users have a one universal field throughout the system for classifying content. So it uses Managed Metadata Terms, which can be centrally managed, e.g., some admin may be responsible for administering the Enterprise Keywords, and perhaps pre-populating, ...


4

No, Taxonomies are built like the following: Taxonomy Group TermSet Term Term Terms however can contain subterms


3

Mmm - I just found this TermSet.GetAllTerms Method If you work for Microsoft and implemented this method - I love you!


3

Another way to set metadata field value to null. You should get TaxonomyField first. TaxonomyFieldValue fieldValue = new TaxonomyFieldValue(field); field.SetFieldValue(item,fieldValue); Item.UpdateOverwriteVersion();


3

I could be wrong but I believe it's something to do with delegation of administration and user permissions- you can apply security restrictions to groups, and each group can have "groups of terms", aka Term Sets.


3

If you create your own ManagedProperty, e.g. 'Terms' and map it to the crawled property 'ows_taxId_MetadataAllTagsInfo', then you can use in your FullTextSqlQuery a condition like: Terms = '#0[TERM GUID]' For the ManagedProperty make sure you check 'Has Multiple Values' and 'Include values from all crawled properties mapped'. See also on MSDN Querying ...


3

The other option, if you've got the field, and the Term is to use the SetFieldValue method and it's overrides, Specifically SetFieldValue(SPListItem, Term). This will handle all the messy WssId details for you, but it assumes you've got the Term already (or Collection of Terms).


3

If you are trying the set the value but you don't have a Term object, you can use -1 as the WssId. SharePoint will automatically assign the correct WssId the the item.


3

Take a look at MatchPoint for SharePoint (where I am working for). It comes with it's own metadata management, but also supports the ootb taxomomy stuff.


3

The easy way to do this is to change the underlying content types for these lists at the site collection level (i.e. Site Actions > Site Settings > Site Content Types (under Galleries). Announcements is pretty straightforward because there is an Announcements content type. You can add the column to that content type and any existing or newly created ...



Only top voted, non community-wiki answers of a minimum length are eligible