directory: add template option

closes #982
closes #990