Sharepoint 2013: How to get metadata terms and their custom properties in unordered list using client script

I have a requirement to create an unordered list by fetching all metadata terms.

each term will have a custom propery "isIncluded". If the value of  "isIncluded" is "Yes" then the term should be shown in the list otherwise it should not be.

the sample list as per requirement is

<ul>

<li>term Set

<ul>

<li>Term1

<ul>

<li>subterm11</li>

<li>subterm12</li>

</ul>

</li>

<li>Term2

<ul>

<li>subterm21</li>

<li>subterm22</li>

</ul>

</li>

</ul>

</li>

</ul>.

any help will be higly appriciated and will save my hours of work.

Thanks in advance,

OERAP


  • Edited by OERAP Tuesday, January 28, 2014 5:49 AM
January 28th, 2014 8:45am

Hi,    

For your requirement, you can take use of the SP.Taxonomy.TaxonomySession object which Wraps all of the associated TermStore objects for a site collection to access the SP.Taxonomy.TermSet object and SP.Taxonomy.Term object to retrieve the properties needed.

Then you can display these properties in the way you like by using JavaScript to generate the HTML control dynamically.

Here are two articles about Working with Taxonomy and JavaScript in SharePoint 2013 for your reference:

http://www.vrdmn.com/2012/12/working-with-taxonomy-and-javascript-in.html

http://sympmarc.com/2013/10/11/spservices-stories-18-retrieve-managed-metadata-using-javascript-and-spservices/

The two links below will provide some useful JavaScript tree view plugins:

http://www.jstree.com/

http://www.queness.com/post/1138/10-javascriptcss-treeview-and-sitemap-plugins-and-tutorials

Best regards
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2014 12:07pm

Hi,

The following thread for you to take a look at:

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/55b46124-02cf-4d7d-8920-696a42540244/get-customproperties-of-term-in-manage-metadata-sharepoint-2013-by-client-object-model?forum=sharepointdevelopment

Thanks

February 7th, 2014 3:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics