Announcement

Collapse
No announcement yet.

Problem overriding lead conversion template

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

  • 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.

  • #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.

    Comment

    Working...
    X