Update relative path functionality to work with n number of $parent tags