Need this code back to generate the right $pagerurl