0

There are two dropdowns for my customization. One of which gets populated with 1 st level Keywords (K1, K2, K3) -(ie if "C" is the cateogory , I have K1 , K2, K3 . These are abstract Keywords. Under K1 I have A1,A2,A3 normal Keywords. K2 has B1,B2,B3 . K3 has C3,C4,C5 ). The second dropdown gets populated based on the selection of First dropdown. If I select K1 then 2nd dropdown has A1,A2,A3. I am currently achieving this by doing the following -

  1. Dropdown 1 loads when I load the category list (var list = category.getListKeywords();) [K1, K2, K3 ]
  2. For dropdown 2 ,for instance dropdown 1 value is K1, I pass the keyword object of K1 and get the using items. var list = keywordObj.getListUsingItems(new Tridion.ContentManager.ListFilter(), false, false);

The second dropdown doesn't load if the user does not have permission to the publication where I have created the cateogory "C". It says no permission to read item tcm:xy-abc-def".

The getListUsingItems returns A1,A2,A3 Keywords tcmids but they are not from the context publication.

I can re-form the keyword tcm id by using the context publication Id. But I wanted to know if there is any other way to get the child-keywords inside an abstract Keyword.

2 Answers 2

1

I got the list of Keywords inside a Keyword as below -

  1. var list = keywordObj.getList(new Tridion.ContentManager.ListFilter(), false, false);
  2. var listXmlDoc = list.getXmlDocument();
  3. var keywords = $xml.selectNodes(listXmlDoc, "/tcm:ListKeywords/tcm:Item");
  4. You can define the filter.
  5. Load the list (Add event handler).

The "keywords" looks like this -

<tcm:ListKeywords xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<tcm:Item xmlns:tcm="http://www.tridion.com/ContentManager/5.0" ID="tcm:402-115887-1024" Title="K1" Icon="T1024L0P0" Type="1024" FromPub="010 Global Schemas" IsNew="false" Modified="2016-03-15T04:03:38" Key="K1" IsAbstract="false" Managed="0"/>
<tcm:Item xmlns:tcm="http://www.tridion.com/ContentManager/5.0" ID="tcm:402-115888-1024" Title="K2" Icon="T1024L0P0" Type="1024" FromPub="010 Global Schemas" IsNew="false" Modified="2016-03-11T03:05:34" Key="K2" IsAbstract="false" Managed="0"/>
<tcm:Item xmlns:tcm="http://www.tridion.com/ContentManager/5.0" ID="tcm:402-115889-1024" Title="K3" Icon="T1024L0P0" Type="1024" FromPub="010 Global Schemas" IsNew="false" Modified="2016-03-11T03:06:22" Key="K3" IsAbstract="false" Managed="0"/>
</tcm:ListKeywords>
0

In Tom.NET

var list = keyword.GetChildKeywords()

in CoreService

var list = client.GetList(keyword.Id, new ChildKeywordsFilterData());

I suppose in cme it should be something like

var list = keywordObj.getListChildKeywords(...)
2
  • In the anguilla documentation , I didnt see any method like this for a Keyword. And this doesnt work. Hence I went for getListUsingItems :(
    – Pari
    Mar 17, 2016 at 12:32
  • TypeError: keywordObj.getListChildKeywords is not a function @Stanislav Maryenko
    – Pari
    Mar 18, 2016 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.