Cheers that worked a treat. In the end I used the page array to get the information i.e. $GLOBALS['TSFE']->page['uid'], as this array also contains the page title and alias.