Results 1 to 7 of 7

Thread: Making fields with URLs clickable

  1. #1
    lmiller is offline Sugar Community Member
    Join Date
    Feb 2010
    Posts
    106

    Default Making fields with URLs clickable

    How do I make fields, other than the Website field become a click-able URL? I use a text field, that is auto-populated, to create a URL that can be clicked, to open up a different page, preferably in a new tab/window like the existing website link does

  2. #2
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: Making fields with URLs clickable

    show your field on detailview.php as

    PHP Code:
    'customCode' => '<a href="{$fields.name.value}">{$fields.name.value}</a>' 
    CRM Software Engineer
    Eontek - www.eontek.rs

  3. #3
    lmiller is offline Sugar Community Member
    Join Date
    Feb 2010
    Posts
    106

    Default Re: Making fields with URLs clickable

    where is that php file located at? i see a file named view.detail.php in /modules/accounts/views is that right?

  4. #4
    lmiller is offline Sugar Community Member
    Join Date
    Feb 2010
    Posts
    106

    Default Re: Making fields with URLs clickable

    Nevermind, I found it, it was locade in /custom/modules/Accounts/metadata/detailviewdefs.php

    Once I added the code
    PHP Code:
    'customCode' => '<a href="http://www.google.com/search?q={$bean->gtd_term_c}" target="_blank">Google Search</a>' 
    under the section for the field that I wanted it to work for, I did a quick repair and rebuild and everything was up and running correctly.

  5. #5
    jacobidesign is offline Junior Member
    Join Date
    Oct 2010
    Posts
    4

    Default Re: Making fields with URLs clickable

    How about making this styled as the buttons? I really appreciated this answer and it showed me something I've been looking for for a while, but in looking at the file referenced above and trying to adapt one of the previous buttons to make a Google search of the full name it doesn't work.

  6. #6
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: Making fields with URLs clickable

    when you write 'customCode' => 'here goes html what ever you want'

    to reference the value of some field you use smarty tags {$fields.nameOfField.value} and it's value will be printed.
    CRM Software Engineer
    Eontek - www.eontek.rs

  7. #7
    sandydomrep is offline Member
    Join Date
    Jan 2011
    Posts
    10

    Default Re: Making fields with URLs clickable

    I am trying to do something similar, but my php skills are non-existent. I need to add a prefix on to the website tab to complete the URL.
    Am using Version 6.1.1 CE (Build 5512) and have found the following reference on the detailviewdefs.php file.

    array (
    'name' => 'website',
    'type' => 'link',
    'label' => 'LBL_WEBSITE',
    'displayParams' =>
    array (
    'link_target' => '_blank',
    ),
    ),

    but have no idea where to put the custom code in. The prefix that I want to use would be something like e.g. 'www.example.com/search/show.php?id='

    Any suggestions would be appreciated.
    Thanks. Sandy
    Last edited by sandydomrep; 2011-01-22 at 09:39 PM. Reason: .

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Making a field clickable in subpanel
    By Socal in forum General Discussion
    Replies: 8
    Last Post: 2010-07-06, 04:57 AM
  2. custom 'web link' fields for long urls
    By doyle in forum Feature Requests
    Replies: 2
    Last Post: 2010-02-21, 10:04 PM
  3. Making fields clickable
    By Jamman960 in forum Help
    Replies: 1
    Last Post: 2006-03-07, 03:00 PM
  4. Making a website field Clickable
    By sugaruser555 in forum Help
    Replies: 8
    Last Post: 2005-07-12, 03:36 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
  •