Creating the page query for the page commands