Changes calculation of pathToRoot. Now uses slug field and path field as a fallback