1. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you or to your Kayako. You can visit the forums for the new Kayako here.

Custom field example

Discussion in 'Developing, APIs and extending' started by molnar.jozsef, May 7, 2012.

  1. molnar.jozsef

    molnar.jozsef New Member

    Hi!

    Please make a complete example "Hello world!" code, how can we display a custom field in "Admin CP / Templates / Templates / General / customfields"

    HTML:
    ...
    <{if $_customField[fieldtype] == 'custom' && $_customField[valuetype] != 'static'}>
    <!-- PLACE CUSTOM FIELD TYPE HTML CODE HERE -->
    <{else}>
    ...
    But what???

    Fusion v4.40.1079 didn't work on Organisation tab:
    kayak_custom_field_example.png

    Thanks!
     
  2. jojoworld

    jojoworld Member

    Hello,

    I recommend as a first step to rename the field name like this: "my_custom_field"(recommended if you manage multiple custom fields on a unique template).

    Here's an example:

    Code:
    ....
    <{if $_customField[fieldtype] == 'custom' && $_customField[valuetype] != 'static'}>
        <{if $_customField[fieldname] ==  'my_custom_field'}>
              <tr>
                  <td>URL of your website</td>
                  <td>http://<input type="text" name="<{$_customField[fieldname]}>" value="www.example.com" class="my_own_class" onchange="javascript:...." /></td>
              </tr>
        <{/if}>
    <{else}>
    ....
    Customfield in the example looks like a text field, but with some additions allowing you to have a better presentation and use javascript event.

    Personally, I use it to retrieve a dynamic list with ajax
     

Share This Page