We are trying to implement the same. Is there any way to do a call within a component?
I found it strange that this was not an OOTB functionality. So.... in typical fashion, I wrote my own. If anyone knows a better way - let us know.
Please understand that if you can't extrapolate what I've provided below, then I suggest you hire a TS/LS consultant/expert to fill in the gaps. What I'm providing is ONE possible solution outline. There are others. Also note that you may run into other challenges further down the road. It is possible to get all this to work, even when display values change.
It takes three steps.
Step 1 - add something like this to your component's Content XML section:
<External><Parameters><Datum ID="taxItem" Name="Something from the taxonomy" Type="SelectMultiple" Exposed="true"> <Generator Method="someMethodToReturnTaxonomy" Object="com.xxxx.xxxx.SomeClass"> <Parameters> <Datum ID="taxonomy" Name="taxonomy" Type="String">Tax Name</Datum> </Parameters> </Generator></Datum></Parameters></External>
(notice you will need to customize that code to meet your needs - in the example above "Tax Name" is the name of the taxonomy you want)
Step 2: create "SomeClass" with the method of "someMethodToReturnTaxonomy"
public Document someMethodToReturnTaxonomy(PropertyContext context) { //get taxonomy name from the Component's Parameters String whichTaxonomy = (String) context.getParameters().get("taxonomy"); Document doc = Dom4jUtils.newDocument(); Element base = doc.addElement("Options"); // Some magic occurs and you have all the taxonomy items you want // in some list // loop over the items you want to add Element option = base.addElement("Option"); String count = counter.increment(); option.addAttribute("Order", count); option.addElement("Display").addCDATA("text from taxonomy"); option.addElement("Value").addCDATA("value from taxonomy"); return doc;}
Step 3: do a TeamSite build.
Again, if you don't know what happens with a build or how to get this into the right area, you should probably bring in a contractor who does.
Good luck
P.S. The code above is absolutely unworkable in its current state and will NOT work in your environement. It is only a shell and an idea of how to get a pickable list in a component from the taxonomy.