Results 1 to 4 of 4

Thread: Add "target" parameter to "Website" link

  1. #1
    madmat is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    Germany
    Posts
    164

    Question Add "target" parameter to "Website" link

    Hi,

    right now (sugar5.0) the website links for accounts open in the same window.
    So I tried to change that by editing detailviewdefs.php for accounts:

    PHP Code:
     array(array('name'=>'website''type'=>'link'), 'phone_fax'), 
    into
    PHP Code:
     array(array('name'=>'website''type'=>'link''customCode' => '<a target="_blank" href={$fields.website.value}>{$fields.website.value}</a>'), 'phone_fax'), 
    That kinda works, the only problem is - it now puts the baseurl in front of the link.
    Instead of "http://www.heise.de" I get "http://crm.company.de/www.heise.de".

    Any ideas on this?

    Thank you!

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Add "target" parameter to "Website" link

    Hi, madmat

    Perhaps you have to manipulate the $fields.website.value in the view.edit.

    Cheers

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

  3. #3
    madmat is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    Germany
    Posts
    164

    Default Re: Add "target" parameter to "Website" link

    It was easier than I thought it would be:

    PHP Code:
    href=http://{$fields.website.value} 
    does the trick.
    Sugar strips the "http://" if entered on creating/editing an account - so this should work fine.

    The only problem I see could arise when importing records, the trailing "http" is not being removed there.

    Thanks for your time!

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Add "target" parameter to "Website" link

    Hi, madmat.

    You can use the function str_replace for rermoving this trailing 'http', or chech if the field has this string as a default value and change this into extended vardefs.

    Cheers

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Add link on a phone number
    By Orbiplanax in forum Developer Help
    Replies: 5
    Last Post: 2007-11-29, 09:26 AM
  2. Replies: 3
    Last Post: 2007-10-05, 06:54 PM
  3. add dashlett link not showing
    By swrose in forum Help
    Replies: 5
    Last Post: 2007-04-30, 03:04 PM
  4. Merge Contacts show sql error
    By hheckner in forum General Discussion
    Replies: 5
    Last Post: 2006-10-04, 01:57 PM
  5. How to link 2 modules and add the subPanel
    By tarze in forum Developer Help
    Replies: 1
    Last Post: 2005-12-02, 06:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •