I am trying to get the Local Properties for the Navigation Term that is currently being viewed.
For example... If I navigate to
http://sp2013/about/team I need to get the Local Custom Properties for the term Team.
Current Solution (performance issues):
- Get the Term in the URL
window.location.pathnameof the current page
- Get the default Term Store
- Get Group that Term is in
- Get Term Set that Term is in
- Get Term About (from /about/team)
- Get Term Team (from /about/team) and then read Custom Properties.
The performance of this is quite bad because there are so many executeQueryAsync's being called, and the deeper the URL the more queries there will be!!
Other Possible Solutions??
- Is there a way to just get the Navigation Term that is being viewed on current page with one query?
- Is there a way to search ALL the Terms in a Term Set a retrieve Term based on Friendly Url (where Friendly Url = window.location.pathname)?