Navigation helper
Permalink Browser Info Environment
Hi
I believe I found, and fixed, an error with regard to External pages in the site tree. The problem is when the external link has a subpage e.g.http://www.domain.com/subpage, that the helper override strips anything after the main url. The fix was simple - check whether the cObj is an external link, if not, proceed with the rest of the helper, otherwise just return the url.
cheers
I believe I found, and fixed, an error with regard to External pages in the site tree. The problem is when the external link has a subpage e.g.http://www.domain.com/subpage, that the helper override strips anything after the main url. The fix was simple - check whether the cObj is an external link, if not, proceed with the rest of the helper, otherwise just return the url.
<?php defined('C5_EXECUTE') or die("Access Denied."); class NavigationHelper extends Concrete5_Helper_Navigation { public function getLinkToCollection(&$cObj, $appendBaseURL = false, $ignoreUrlRewriting = false) { $url = parent::getLinkToCollection($cObj, $appendBaseURL, $ignoreUrlRewriting); Loader::model("mapping", "multiple_domains"); $map = MultipleDomainsMapping::getByCurrentDomain(); if(!$cObj->cPointerExternalLink) { if (is_object($map) && is_object($p = $map->getMappedPage())) { if ($p->getCollectionID() > 0) { // Replace the first occurrence of the sub-domain URL $url = preg_replace('#' . $p->getCollectionPath() . '#', "", $url); } } $find = DISPATCHER_FILENAME . "/";
Viewing 15 lines of 23 lines. View entire code block.
cheers
Type: | Discussion |
---|---|
Status: | In Progress |
This only seems to happen if the target URL contains the exact path that your mapped page has defined for it. E.g. in the following case:
1. Your mapped site has an URL of /sites/uber-site
2. You're linking to an external site with URL: http:// www. external.com/something/sites/uber-site/something-else
In this case, the external URL would become:
http:// www. external.com/something/something-else
We'll put this on our list to fix and update the marketplace code after getting this fixed. Does not seem like a high priority issue though since it's such an edge case.
Thanks for the report!
Antti / Mainio