keywordSelectChoices ordering

In Rhythmyx 6.50 we are using $rx.keyword.keywordSelectChoices to get a list of keyword values for a select list that is output in a page template.
The order of the options returned seems to be that in which the items were entered into the RXLOOKUP table. Is there a way to get them ordered by the sequence number?

Jason,

I looked at the code, and indeed there is no way to specify the sort order.

There are a couple of options:

  1. Write your own query using $rx.db.get()
  2. Write your own JEXL function that calls IPSContentService.findKeywordsByLabel()

We probably should fix this someday. I don’t see any issues in the database, so I’ll add one for you.

Thank you for the suggestions. We added a macro to return the results using $rx.db.get() and these come out ordered.

Did the ordering ever get fixed when pulling keywords? Also which table are the keywords in? Is there anyway to look at table information without having direct access?

The table is RXLOOKUP.

Here is the query we used:

select LOOKUPVALUE from rmx.RXLOOKUP where LOOKUPTYPE = (select LOOKUPVALUE from rmx.RXLOOKUP where LOOKUPDISPLAY=‘KEYWORD_NAME’) order by LOOKUPSEQUENCE

Hello

We probably should fix this someday. I don’t see any issues in the database, so I’ll add one for you.
:slight_smile:

This would be very helpful David, as I have had to ‘recreate’ Keyword lists before now because they were not ordered in the way the content people wanted. Luckily they are quick and easy to set up! Strange that this has been overlooked for so long though…

Cara

I’m a little sketchy on the velocity syntax. Can someone post an example of the velocity syntax for using the $rx.asmhelper.mapValues to get the keywords out of the $rx.db.get() object? Or if there is a better way that would be great too. The documentation recommended using that mapValues function.

Thanks.

John

John,

The Version 6.6 Rhythmyx Implementation Guide has a topic illustrating the use of these functions. See “Defining Bindings to Publish Child Data from an External Repository”, p. 382.

RLJII

That was what I needed.

Thanks.

John