Problem overriding lead conversion template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tim
    Junior Member
    • Aug 2024
    • 18

    Problem overriding lead conversion template

    I'm trying to override client/modules/crm/res/templates/lead/convert.tpl

    I have added

    Code:
    "views": {
      "convert": "custom:views/lead/convert"
    }
    ​
    to custom/Espo/Custom/Resources/metadata/clientDefs/Lead.json

    I have tried "views" and "recordViews" (not sure what is the difference to tell the truth), also both "custom:views/lead/convert" and "custom:lead/convert"

    Then I added client/custom/src/views/lead/convert.js with following content:

    Code:
    Espo.define('custom:views/lead/convert', 'views/lead/convert', function (Dep) {
      return Dep.extend({
        template: 'custom:views/lead/convert',
    
        setup: function () {
          Dep.prototype.setup.call(this);
        },
    
        afterRender: function () {
          Dep.prototype.afterRender.call(this);
        }
      });
    });
    And finally the template itself to client/custom/res/templates/lead/convert.tpl with some dummy content. Also tried custom/Espo/Custom/Resources/templates/lead/convert.tpl

    The rewrite does not work. Any advice is appreciated. Thank you.
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    The view is hardcoded in the controller. I used a GitHub search in the repository to find out. https://github.com/espocrm/espocrm/b...rs/lead.js#L35

    Maybe try to create a custom frontend route to override the default controller action.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...