Implement getDefaultWhere function and filter slugify for templates