Fixes #6570 - Dynamically fetch pages for sidebar