21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 591 Views |
-
Usability issue inserting links

3 March 2010 at 2:30am
This is not a real question or bug but more a usability issue I came across that I would like to see considered.
I've used Xenu link checker on a site, after one of my clients has used the SilverStripe CMS system for a couple of months. I've noticed that for external links they often forget the http:// bits. Trying this myself I have noticed the following happening when creating an external link:
1. I select Link to 'Another website'.
2. I paste the URL, but forget adding 'http://', starting with www only as my client does.
3. Inserting the link Silverstripe reverts the link to 'Page on the site' rather than 'Another website'Wouldn't it make more sense if SilverStripe automatically adds http:// if 'Another website' is selected rather than revert to 'Page on the site'?
-
Re: Usability issue inserting links

3 March 2010 at 5:42am
This would make a lot of sense, either that or validator checks to ensure http:// is present if someone adds an external link.
Mo
-
Re: Usability issue inserting links

3 March 2010 at 8:26pm
this can be archived by adding the following function into your page type class.
public function onBeforeWrite() {
parent::onBeforeWrite();
$url = $this->ShoppingCartButtonLink;
if($url) {
if(substr($url, 0, 8) != 'https://') {
if(substr($url, 0, 7) != 'http://') {
$url = $this->ShoppingCartButtonLink = 'http://' . $url;
}
}
}
$this->ShoppingCartButtonLink = $url;
}The 'ShoppingCartButtonLink' is one of the external link I added in one of my page.
| 591 Views | ||
|
Page:
1
|
Go to Top |



