Forum OpenACS Q&A: Response to Categories in OpenACS 4

Collapse
Posted by Peter Alberer on

I do not think that there is a good table that you could use for something like categories (the acs keyword system is cr_items only i think) but you can easily use the tree_sortkey solution in other tables.

You just need to create a table with a node_id, a parent_id and a tree_sortkey column. (the columns you mentioned would be ok i think) Then you should assign triggers that generate the tree_sortkey on inserts and updates.

i am not sure how the functions have to be like, as the sortkey issue has changed some weeks ago but just check out the current versions of these functions for the cr_keyword table for example.

This is in /packages/acs-content-repository/sql/postgresql/content-create.sql, there you can find examples for relevant trigger functions and also have a look at the keyword system.