Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

7

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(){ ...


3

I have been looking for the answer to this one too. The following should retrieve the extra properties: //paste code on one line context.load(tsTerms, 'Include(IsRoot, Labels, TermsCount, CustomSortOrder, Id, IsAvailableForTagging, Name, PathOfTerm, Parent, TermSet.Name)'); The following blog had some good examples that have helped me get my code working. ...


3

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 ...


2

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 ...


2

Solved it by setting the navigation to term driven navigation, this however created a new problem with the quick launch not showing the parent terms. New solution! Please check the answer to this question.


2

What you could do is convert the list of your terms in something that is querable by LINQ and use it. For example: TaxonomyFieldValue v = null; TermCollection childTerms = null; var session = new TaxonomySession(site); if (session.TermStores != null && session.TermStores.Count > 0) { var termStore = session.TermStores[...


2

You can create a webpart which can search for collection of terms using this method, Term.GetTerms Method (String, Int32, Boolean, StringMatchOption, Int32, Boolean) MSDN Source Here's some sample code, TaxonomyFieldValue v = null; // Notsurehowtodothisbit(); TaxonomySession session = new TaxonomySession(site); if (session.TermStores != ...


2

I have added a input button with ID btnTaxonomies, which is fetching the Terms from the Terms store using JSOM $(document).ready(function () { $('#btnTaxonomies').click(function () { SP.SOD.registerSod('sp.taxonomy.js', SP.Utilities.Utility.getLayoutsPageUrl('sp.taxonomy.js')); $('#btnTaxonomies').val("Getting Taxonomies, ...


2

You can use getTerm method in sp.taxonomy.js library. //Current Context var context = SP.ClientContext.get_current(); //Current Taxonomy Session var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(context); var term=taxSession.getTerm("id of the term"); See more details here . http://msdn.microsoft.com/en-us/library/office/...


2

I've had good success with this tutorial So if the guid for Sales and Marketing is c8a43f13-5ea1-45f2-b46d-3a1986a1cbd7 this would get all things tagged with a child of that. owstaxIdItemType:"GPP|#c8a43f13-5ea1-45f2-b46d-3a1986a1cbd7" But that wouldn't include anything that is actually tagged Sales and Marketing. If you want to have that included you ...


2

Radu Tut wrote the post Managed Metadata Navigation for Multiple Site Collections in SharePoint 2013, stating: "When you try to bind the same navigation term set to a new site, you will get a message that says the term set is already bound to a different site, and if you choose to proceed, the navigation settings for the other site will be broken." I don't ...


2

Unfortunately you cannot import labels using OOB import functionality. I recommend using Lapointe.SharePoint.PowerShell.wsp found here and here to do the import. It supports also labels. You can do first an export to get sample XML out, then modify it, and finally do import. It will not overwrite existing terms (will throw error), so you need want to remove ...


2

GetTerms returns a TermCollection object, which, even if it's empty, will not be null. You probably want to do something like: TermCollection results = termSet.GetTerms("MyTerm", false); if (results.Count == 0) { termSet.CreateTerm("MyTerm", 1033); termStore.CommitAll(); }


2

You may need to manually refresh the cache; if you are trying to use the term immediately after creating it then it may not have had enough time to propagate. If you are using JSOM, try adding a call to termStore.updateCache() in the executeQueryAsync function, like below:. var termSetId = "77ccf69b-b17e-40cf-8589-7bebc8ee6c9c" var newGuid = SP.Guid.newGuid(...


2

Write code as below: string url = " http://sitecollection/page.aspx>k=hr"; string title = "HR"; SPNavigationNodeCollection quickLaunch = web.Navigation.QuickLaunch; SPNavigationNode newnode = new SPNavigationNode(title, url, true); web.Navigation.QuickLaunch.AddAsLast(newnode); or another method is: var newNode = new SPNavigationNode("HR", "http://...


2

There are couple options you can try. You can call TermSet.GetAllTerms() method to return all terms under that TermSet. Another approach you can try is to use recursive function to enumerate termSet.Terms and term.Terms I list the code for approach 1 at the following. You can check term.PathOfTerm to find out the term's hierarchy information. class ...


2

Add a pipe e.g. '|' to the list 'Qualifications;BSc|BA'


2

I think you can use it for long time as long as that term is exist in the term stores. as this property "A 32-bit integer that uniquely identifies the list item containing the taxonomy field in a list" Here is good explanation of the wssid When you assign value a TaxonomyField, an item is created for the selected Term (or if there is already an item ...


2

There is a known bug where single select taxonomy terms will not return the expanded/human readable label. If you can change your field to multi-select they will expand correctly. Of course that might not be a good choice for other reasons. Otherwise you can do a couple of things. Instead of using a GET call to the /items you can use a POST to the ...


1

omg, I found the error, and I cant find an explanation on this, hopefully somebody at Microsoft can tell me. this line: var termStore = termStores.getByName("Taxonomy_kl5tZjInn7STsFTzIE7n3Q=="); We noticed the name is now different, it has a different guid, but we as customers cant change that name, so the only reason is Microsoft changed it for ...


1

You can make use of properties Terms or TermsCount. This property provides the list of immediate Terms. So in your case you can use following logic if(term.Terms == null || term.Terms.Count == 0) //means this term has no childern if(term.TermsCount == 0) //means this term has no childern


1

You can use Script Created by http://blog.falchionconsulting.com/index.php/downloads/ There is a cmdlet that allows to export terms into an XML file and another cmdlet that allows importing from xml file. http://www.falchionconsulting.com/PowerShellViewer/Default.aspx?Version=SP2010&Cmdlet=Export-SPTerms http://www.falchionconsulting.com/...


1

You can get the store (by name) then the SP.Taxonomy.TermCollection and then the term by name. Based on: Working with Taxonomy and JavaScript in SharePoint 2013 $(document).ready(function(){ var scriptbase = _spPageContextInfo.webServerRelativeUrl + "_layouts/15/"; $.getScript(scriptbase + "SP.Runtime.js", function () { $....


1

How to retrieve Term via SharePoint JSOM Use SP.Taxonomy.TaxonomySession.getTerm Method to get a Term object that is based on Term IDs: function getTerm(termId,success,failure) { var context = SP.ClientContext.get_current(); var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(context); var term=taxSession.getTerm(termId); ...


1

You can see if the Web Analytics Web Part is sufficient to you: http://blogs.msdn.com/b/ecm/archive/2010/03/21/introducing-web-analytics-in-sharepoint-2010.aspx If not, then you can write your own custom web part that use web analytics to present it to the user. This blog post might be of interest: http://matthewyarlett.blogspot.co.uk/2012/10/getting-...


1

If you know there term ID which you can get from the MMS Term Store Manager or the Tag Summary Page you can your the following syntax to get all descendant children of the MMS property ItemType (the # at the beginning indicates child terms): owstaxIdItemType=#52263385-1fc3-4323-8d6b-50c8f6c3c45d:"reference materials" Ref: http://msdn.microsoft.com/en-us/...


1

When you get the "Object reference not set to an instance of an object" that means that it's expecting not null value and you give it null value. The cast that you are making is returning null. var taxField = item["Application"] as TaxonomyField; Since you are geting the lable of only one field "Application" you can check if it is a Multiple Value Field ...


1

I think this article should help you: http://msdn.microsoft.com/en-us/library/office/ff625182(v=office.14).aspx It says: By passing true to the bool includeDescendants parameter to TaxonomyField.GetWssIdsOfKeywordTerm, you get the lookup IDs for the term with the specified GUID, and you get the IDs for all its child terms. Once you get ID you can query ...


1

With that many terms, I think it would be better to use External Content Types, rather than MMS term sets. Have you considered that possibility? For one thing, I'd imagine that the relevant data is in a database somewhere, given the volume of items. Using external content types also ensures you're not forced to maintain a large volume of metadata that ...


1

Loading SharePoint TermStore is very easy. you have load default terms and then have to get the term store by name. and also you can get additional properties of the term store. you can get more details in this article. This Article may be helpful for you. Please mark it as answer if it is helpful. http://www.sharepointsol.com/2015/06/SharePoint-2013-JSOM-...


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