Implement template directory list function