adds sorting template for cats and selections