Replaced usage of strtolower($pageType['TypeS']) with $pageType['FriendlyId'] since these are not always identical