I have two Categories, that I want to bind with two dropdown lists on a page. When selecting a value in the first dropdown, the second dropdown should be populated with the values from another Category. How can I map two Categories on runtime using SDL Tridion APIs?
-
1Please post some code to show us what you've tried so far, and tell us which version of Tridion you are using.– Dave HoulkerCommented May 2, 2013 at 7:12
-
Do have any more details on the problem please? For example, does the value (Keyword) selected in the first dropdown affect the options (Keywords) available in the second? If so, what is the logic behind this (e.g. Only display Keywords in the second dropdown that are associated with Components tagged with the value selected in the first)?– Jonathan WilliamsCommented May 2, 2013 at 8:36
-
when i select some value from 1st drop down some mapped value will be displayed on the another dropdown.Now i have confustion here ,is it possible to have this kind of functionalities by using single category and with its subkeywords or we need to have two separate categories for this.– roopCommented May 2, 2013 at 9:52
-
i m using sdl tridion sp1 2011– roopCommented May 2, 2013 at 9:52
2 Answers
Yes, you can do this using a single Category and nested keywords.
Take a look at the API documentation, the online documentation (login required), forums and some other Stack Exchange questions for TaxonomyFactory
, TaxonomyFilter
and ExpandKeywords
.
The online documentation (login required) describes the TaxonomyFilter
as:
Calls a method which defines a filter for displaying only a part of the taxonomy.
As per my understanding, you can do this way:
First map the key's in the form of below representation
CAT A
- Key A
- Add
RelatedKeyword
as BA
- Add
- Key B
- Add
RelatedKeyword
as BB
- Add
- Key C
- Add
RelatedKeyword
as BC
- Add
- Key A
CAT B
- Key BA
- Key BB
- Key BC
- Now render the 'A' dropdown from CAT A and corresponding 'B' dropdown from
RelatedKeywords