set root dir if actual dir is empty
improved HTML in content templates