Closed grange85 closed 8 years ago
I'm going to extend this to "all external links" - I was thinking something along these lines - but happy to have other ideas...
define ("SITE_BASE_URL", "/about/our-role/");
function fix_internal_url($url) {
$pattern = "/http:\/\/(.*?)\.gov.uk/(.*?)/";
$replace = SITE_BASE_URL . '$2';
return preg_replace($pattern, $replace, $url);
}
And then by default hit this function for all internal links - the function could exist in tna (and tna-base) with SITE_BASE_URL defined as "/"?
There obv may be ab easier/safer way so happy to go with that.
The fake code pattern above assumes a full url - so will need to be adapted for other urls (and possibly some conditions so it only runs on appropriate urls...
Thouhts @domingobishop @punalsc @matt-blair @sdwilkes ... ?
Short term fix has been implemented
Still required:
The generated breadcrumbs need to have the complete and correct path