'Page URL', 'pi_version' => '1.1', 'pi_author' => 'Brian Litzinger', 'pi_author_url' => 'http://www.brianlitzinger.com/ee/', 'pi_description' => 'Get the absolute URI to a page based on ID', 'pi_usage' => Page_url::usage() ); class Page_url { var $return_data; function Page_url() { global $TMPL, $PREFS; $entry_id = $TMPL->fetch_param('entry_id') ? $TMPL->fetch_param('entry_id') : false; $base = $TMPL->fetch_param('include_base') == 'n' ? '' : $PREFS->ini('site_url'); if(!$entry_id) { // fail loudly. return $OUT->show_user_error('general', array('{exp:page_url} does not have an entry_id defined.')); } $pages = $PREFS->ini('site_pages'); if(!isset($pages['uris'][$entry_id])) { // fail quietly. return ''; } else { $page = $pages['uris'][$entry_id]; } if(substr($base, -1, 1) == '/' and $base != '') { $base = substr_replace($base, '', -1); } $this->return_data = $base . $page; return $this->return_data; } function usage() { ob_start(); ?> If using the Pages or Structure modules, just pass in the entry_id of a page to obtain a full path to the page. {exp:page_url entry_id='29'} The base site_url is included by default. To return just the URI to the page, and not a full qualified http:// path, just set include_base to 'n' {exp:page_url entry_id='29' include_base='n'}