added tpl option and linkdate functions