adapted tamouse's dropdown markup to provide default title, take in pattern, and build nested dropdowns