add page class with title and slug methods