Implement automatic menu based on pages