Improve layout handling for site and page