handle templates in queries
access to pubdate field in templates