Function for getting the path of the category