Hello,
I have a problem with a custom button for bueditor. Perhaps someone here can help me ;)
What should happen:
There is a link in the textfield (for example "http://www.drupal.org/project/bueditor").
The user can mark that link, click on my button and the link should get formatted in the following way:
<strong>Further information</strong>
<a href="http://www.drupal.org/project/bueditor" target="_blank">www.drupal.org</a>At the moment I use the following "script" as a button:
<strong>Further information</strong>
<a href="%TEXT%" target="_blank">Link</a>Most of the things I need works. My only problem: The link-name is "Link" and not the domain host (for example "www.drupal.org") at the moment.
Has someone an idea how I can extract the domain host from the url and use it as link-name?
With php, it would work like this:
$domain = parse_url($url);
return $domain["host"];
But how can I get this into the button script?
Comments
Comment #1
ufku commentedTry this
Comment #2
Stephen.K commentedTHANKS!
Works perfectly...
Comment #3
ufku commented