Check that layout is defined before checking for pageids