Results 1 to 6 of 6

Thread: HTML field

  1. #1
    danweifis is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    20

    Default HTML field

    Hello, I want to set an html link code in a field. This link is different for each row.

    For example for user a:

    <a href="http://www.activation1.com" target="_blank" >Activation1</a>

    for user b:

    <a href="http://www.activation2.com" target="_blank" >Activation2</a>


    And the user a will see only Activation1, and b Activation2

    I still can't find the solution, if somebody can help me would be great

    Thanks

    Daniel

  2. #2
    genius786's Avatar
    genius786 is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Karachi, Pakistan
    Posts
    131

    Smile Re: HTML field

    Hi, Daniel


    Where you write this code. According to my understanding. I will give you the following suggestion


    PHP Code:
          if ($current_user == "User-a")
                   <
    a href="http://www.activation1.com" target="_blank" >Activation1</a
          if (
    $current_user == "User-b")
                  <
    a href="http://www.activation2.com" target="_blank" >Activation2</a
    May be the above code give you some hints......



    Best regards,
    SARFARAZ AHMED KHAN
    Karachi, Pakistan
    skype: genius_crystal
    genius_crystal@hotmail.com
    92-314-2595624

  3. #3
    danweifis is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    20

    Default Re: HTML field

    Hello, thanks, I think I expressed wrongly.

    I want to create a field clickable. This field allows my users to see a single page assigned to each account.

    That's mean, the account 1 will get a single link and this link will be displayed in a single link.

    Thanks

    Daniel

  4. #4
    genius786's Avatar
    genius786 is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Karachi, Pakistan
    Posts
    131

    Unhappy Re: HTML field

    Hi,
    Daniel



    I can't Understand What u r trying to say ...... ????



    Best regards,
    SARFARAZ AHMED KHAN
    Karachi, Pakistan
    skype: genius_crystal
    genius_crystal@hotmail.com
    92-314-2595624

  5. #5
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: HTML field

    Hi,

    the standard html fields in sugar will not display text that links to a url, it will desplay the url.
    You will need to create your own field type. Probably two fields, one for the text "Activation 1" and one for the url.

    Then create a field that displays them as a url link. There is an example of creating custom field types in the developers manual here
    http://developers.sugarcrm.com/docs/...ide.1.111.html
    and you can have a look at a small barcode module I wrote to display barcodes as an example here
    http://www.sugarcrm.com/forums/showthread.php?t=41546

    M
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

  6. #6
    christianknoll's Avatar
    christianknoll is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Vienna
    Posts
    939

    Default Re: HTML field

    In the detailviewdef for the view (or editviewdef .. does not matter) before the assignment of $viewdefs happens ...

    if ($current_user == 'John') $myLink = "<a href ....>Johns view</a>";
    if ($current_user == 'Jack') .... ;

    $viewdefs['module'][...

    then for the definiton of the Field set the property 'customCode' = $myLink.

    With that when the view is processed the file is included, your logic for assignment to a user is processed and when the field is displayed your custom HTML link get's viewed.

    easy. prgamatic, hasslefree ... enjoy ...

    Quote Originally Posted by danweifis View Post
    Hello, I want to set an html link code in a field. This link is different for each row.

    For example for user a:

    <a href="http://www.activation1.com" target="_blank" >Activation1</a>

    for user b:

    <a href="http://www.activation2.com" target="_blank" >Activation2</a>


    And the user a will see only Activation1, and b Activation2

    I still can't find the solution, if somebody can help me would be great

    Thanks

    Daniel

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Customer html field using {ID}
    By jne in forum Help
    Replies: 4
    Last Post: 2008-07-04, 12:48 PM
  2. Replies: 0
    Last Post: 2008-07-02, 10:11 PM
  3. SugarPortal HTML Field Lenth
    By npolite in forum Help
    Replies: 0
    Last Post: 2008-06-05, 04:29 PM
  4. Field Type 'html'
    By jjwdesign in forum Developer Help
    Replies: 0
    Last Post: 2008-02-05, 08:17 PM
  5. Replies: 0
    Last Post: 2008-02-01, 08:01 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
  •