set rootDir for template files; test on parentTemplate maybecome true for ''.