tmpl logic for snippets.