Small fixes to template pages and template tag to sort pages in menu