simplify directory example and use $url in templates