Announcement

Collapse
No announcement yet.

adding an extra line to address field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • adding an extra line to address field

    Hello, I am trying to add an extra line to address field. Came across this post: http://forum.espocrm.com/forum/gener...d-to-addresses, it did not work for me though. Could anyone help?

  • #2
    Hello
    This topic describe all the process with paths and examples. Could you show, what you do?

    Comment


    • #3
      Hello,
      I tried creating the file custom/Espo/Custom/Resources/metadata/fields/address.json and client/custom/src/views/fields/address.js.

      For step 3, I am not sure what I should do. Do I copy the two .tpl files from client/res/templates/fields/address/ to client/custom/res/templates/fields/address/?

      Comment


      • #4
        If you define templates in view, the have to exist. You can copy or create template, but has to be located in the path you set. In example it is client/custom/res/templates/fields/address/

        Comment


        • #5
          Being an inexperienced developer, I'm sorry if I'm asking the obvious...
          Let me first write out all the steps I took, and please correct me if I did something wrong!

          GOAL: to add an extra line above the current "Street" row

          1. Create a file "address.json" under the path custom/Espo/Custom/Resources/metadata/fields/address.json, with the following code:
          Code:
          [COLOR=#000000][COLOR=#007700]{
            [/COLOR][COLOR=#DD0000]"view"[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#DD0000]"Custom:Fields.Address"[/COLOR]
          [COLOR=#007700]}  [/COLOR][/COLOR]
          2. Create a file "address.js" under the path client/custom/src/views/fields/address.js, with the following code:
          Code:
          [COLOR=#000000][COLOR=#0000BB]Espo[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]define[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'Custom:Views.Fields.Address'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]'Views.Fields.Address'[/COLOR][COLOR=#007700], function ([/COLOR][COLOR=#0000BB]Dep[/COLOR][COLOR=#007700]) {
           
           [/COLOR][COLOR=#0000BB]detailTemplate[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#DD0000]'custom:fields.address.detail'[/COLOR][COLOR=#007700],
          
           [/COLOR][COLOR=#0000BB]editTemplate[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#DD0000]'custom:fields.address.edit'[/COLOR][COLOR=#007700],
          
          ... [/COLOR][COLOR=#0000BB]OVERRIDEN METHODS [/COLOR][COLOR=#007700]...
          
          });  [/COLOR][/COLOR]
          3. Copy "details.tpl" and "edit.tpl" from client/res/templates/fields/address/ to client/custom/res/templates/fields/address/.

          After doing that, I can't see any new option that allow me to customise the address field from the cPanel.

          Comment


          • #6
            Did you modify templates? Did you add this additional field into templates?

            Comment


            • #7
              Originally posted by tanya View Post
              Did you modify templates? Did you add this additional field into templates?
              I'm afraid not... could you show me how?

              Comment

              Working...
              X