I'm having an issue with SilverStripe treating external URLs as relative links.
I have a DataObject:
class Artist extends DataObject {
private static $db = array(
'Title' => 'Varchar(255)',
'Content' => 'HTMLText',
'Website' => 'Varchar(255)',
);
}
Artist websites are rendered via <a href="$Website" target="_blank">
. The problem is that the URLs are being appended to the base URL of the website, so we end up with something like:
<a href="mysite.com/www.artistsite.com" target="_blank">
instead of the desired:
<a href="www.artistsite.com" target="_blank">
However, if $Website includes the protocol (http or https) then the link works as expected. So if $Website is http://www.artistsite.com then we get:
<a href="http://www.artistsite.com" target="_blank">
This site contains hundreds, and eventually thousands, of client-maintained artist records. Ideally the client would be able to paste in URLs without having to worry about appending http or https to each one.
Anyone have any ideas? It's the same issue as described on the SilverStripe forums but no solution has been posted.
This site on SilverStripe 3.6.