Answered by:
Access Managed Metadata Navigation via JavaScript API?

Question
-
I'm trying to figure out how to access the navigation termset that I've created in SharePoint 2013 via the Javascript Api, so that I can use it in a SharePoint hosted app.
I'm not sure which library I need to include to access the termset bits and I'm not sure what all is available. Does anyone know how to do this?
Tyler Bithell, Chief Technical Architect - Portals B2B Technologies LLC Atlanta GA SharePoint 2013 Blog http://sharepointv15.wordpress.com/ @B2B_Tech_TB
Monday, October 1, 2012 8:05 PM
Answers
-
For accessing the Managed Navigation term set using JavaScript, the libraries to use are SP.Publishing.debug.js and SP.Taxonomy.debug.js. You can find them in the folder Web Server Extensions\15\TEMPLATE\LAYOUTS. These are Client OM libraries. The class definitions and overall usage are very similar to the C# examples linked above, but there are some differences. I would suggest to start with the general documentation for using Client OM with JavaScript:
"Differences Between Managed and JavaScript Object Models"
http://msdn.microsoft.com/en-us/library/ee539429.aspx
If your navigation operations are read-only (i.e. rendering a navigation menu rather than editing it), you could also consider using the REST service. It is documented here:
"How to: Build search-driven mobile apps with the Navigation and Event Logging REST interfaces"
http://msdn.microsoft.com/en-us/library/jj163303(v=office.15).aspx
Hope this helps!- Proposed as answer by Pete Gonzalez del Solar Monday, October 8, 2012 11:58 PM
- Marked as answer by Dmitri PlotnikovMVP, Editor Wednesday, October 17, 2012 4:55 PM
Monday, October 8, 2012 11:58 PM
All replies
-
Not sure about the JavaScript API. Hope the below links can help you in some direction
http://social.msdn.microsoft.com/Forums/eu/sharepointdevelopment/thread/e159e418-f8b6-42a5-b705-09ab8e2172e8
http://msdn.microsoft.com/en-us/library/jj163978(v=office.15).aspx
It's CSOM but not javascript :(.
Monday, October 8, 2012 11:29 AM -
For accessing the Managed Navigation term set using JavaScript, the libraries to use are SP.Publishing.debug.js and SP.Taxonomy.debug.js. You can find them in the folder Web Server Extensions\15\TEMPLATE\LAYOUTS. These are Client OM libraries. The class definitions and overall usage are very similar to the C# examples linked above, but there are some differences. I would suggest to start with the general documentation for using Client OM with JavaScript:
"Differences Between Managed and JavaScript Object Models"
http://msdn.microsoft.com/en-us/library/ee539429.aspx
If your navigation operations are read-only (i.e. rendering a navigation menu rather than editing it), you could also consider using the REST service. It is documented here:
"How to: Build search-driven mobile apps with the Navigation and Event Logging REST interfaces"
http://msdn.microsoft.com/en-us/library/jj163303(v=office.15).aspx
Hope this helps!- Proposed as answer by Pete Gonzalez del Solar Monday, October 8, 2012 11:58 PM
- Marked as answer by Dmitri PlotnikovMVP, Editor Wednesday, October 17, 2012 4:55 PM
Monday, October 8, 2012 11:58 PM -
Did you ever find a way to get the terms from the managed metadata? I have got the site column (which has a term set associated), but I cannot get the terms for the site column.
Tuesday, December 18, 2012 10:26 PM