Storing the labels of selected checkboxtree nodes in hidden fields

Hello,

I don’t suppose anyone can think of a method to extract the labels of the nodes the user has selected (ticked) in a sys_CheckBoxTree control and store them in a hidden field set up for the purpose in the same content type?

The reason for doing this is that we have a checkboxtree control for selecting keywords in almost all our content types. These are stored as ID numbers for at least two reasons* that I can call to mind at the moment. But this means that the actual text of the keywords selected is not stored “in” the content item, so items will not be returned by searches in the Content Explorer or Active Assembly Table Editor (aka Related Content Control) using these keywords. For example, an author of an item might tick the keywords “Astronomy” and “Hubble” in a content item he creates, then a month later would reasonably expect to be able to find that item again by doing a search for “Astronomy” and/or “Hubble”, either to find the item again and do some more work on it, or to add it into a slot of a different item. But he won’t find it, because the those two keywords are stored as their ID numbers: 456 and 792.

I don’t suppose there exists an input/ouput transform or pre/post processing extension that would allow these keywords to be pulled out and stored in hidden field, so they will be included in searches? Or any other method anyone can think of?

Thanks,

Andrew.

  • First that lots of our keywords are names of organisations, departments, etc, which may well change in the future, hence storing an ID, then using some custom code in page templates to extract the values from the same XML file that provides the options in the checkboxtree is a method of future-proofing. Second, if IDs contains the full text of the keyword, problems such as described here occur.)

Andrew,

If you’ve set up the Checkboxtree so that it has BOTH a tree source url and a choice list, the content editor is supposed to take care of adding the keyword labels to the search index properly.

If you only have a tree source url but no choice list, then the control will appear to work, except that the values will not be preserved when a validation error occurs, and the search engine index won’t be updated properly.

Of course, I’ve not tested this recently, and it’s always possible that you’ve stumbled across a bug in the search engine interface code.

One issue that you’ll need to address is how to keep the two lists of keywords in sync. In the past, we’ve used an XSLT stylesheet to transform the tree source XML in to the correct format for the choice list (which is given in sys_lookup.dtd).

Dave

Sorry, just to make sure I understand what you are suggesting:

Currently have a tree_src_url parameter set up in the Control tab of the sys_CheckBoxTree control and, on the Choices tab, the Retrieve from xml application radio button is selected, pointing to an application, which is also passed at tree_src_url param pointing to the same XML file.

When you say…

If you’ve set up the Checkboxtree so that it has BOTH a tree source url and a choice list, the content editor is supposed to take care of adding the keyword labels to the search index properly.

…do you mean by we should select the Use a keyword radio button instead, and set up a keyword list in the Workbench containing the same choices as currently supplied by the XML file, with the same label (a text string) and same value/ID (a number) for each choice - and Rhythmyx would then store the labels along with the values/IDs, allowing searches to match labels?

Andrew.