Results 1 to 4 of 4

Thread: Custom fields -- how to get Display Label?

  1. #1
    Linnane is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    64

    Default Custom fields -- how to get Display Label?

    Hi,

    Sugar version 6.3

    When developing custom sugar fields I am able to get and use the Field Name : {{sugarvar key='name'}}

    But how do I get and use the other field attributes? Specifically I want the "Display Label" but it would be good to know the others too.


    Regards
    Alan.

  2. #2
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    2,224

    Default Re: Custom fields -- how to get Display Label?

    Quote Originally Posted by Linnane View Post
    Hi,

    Sugar version 6.3

    When developing custom sugar fields I am able to get and use the Field Name : {{sugarvar key='name'}}

    But how do I get and use the other field attributes? Specifically I want the "Display Label" but it would be good to know the others too.


    Regards
    Alan.
    {{sugarvar key='label'}} will return you the raw label, but you'll want to wrap in inside a sugar_translate call to get the actual string for the current language.

    PHP Code:
    {sugar_translate label='{{sugarvar key='label'}}' module='{{$module}}'
    John Mertic
    Sugar Community Manager

  3. #3
    Linnane is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    64

    Default Re: Custom fields -- how to get Display Label?

    Hi

    Thanks for your reply ... I've added your code to the DetailView.tpl of my new Custom Field but it returns this: {Array.new_button_c.label' module=''}

    new_button_c is the name of my field. but not the Display Name? Also the code {{sugarvar key='label'}} returned no value.

    Have you any other ideas / help?


    Regards
    Alan.

  4. #4
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Custom fields -- how to get Display Label?

    I haven't sure, but maybe you could try 'vname' instead of 'label'.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Showing System Label NOT Display Label
    By banning in forum Help
    Replies: 6
    Last Post: 2011-09-19, 09:09 PM
  2. Custom Fields - Display Label
    By sdsource in forum Help
    Replies: 4
    Last Post: 2008-06-12, 11:15 PM
  3. Replies: 3
    Last Post: 2007-08-09, 01:47 PM
  4. Replies: 0
    Last Post: 2006-03-28, 08:26 AM

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
  •