Skip to content

Instantly share code, notes, and snippets.

@melat0nin
Created February 6, 2012 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melat0nin/1751735 to your computer and use it in GitHub Desktop.
Save melat0nin/1751735 to your computer and use it in GitHub Desktop.
c5: use page ID to get link
function getTheURL($url_id) {
$opg = Page::getById($url_id);
$url=Loader::helper('navigation');
$canonical=$url->getCollectionURL($opg);
$canonical=preg_replace("/index.php\?cID=1$/","",$canonical);
echo $canonical;
}
<a href="<?php getTheURL(140); ?>">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment