Sort term menus by term code