Handlebars.registerHelper smartdocs template

Is it possible to register HandleBars helpers in a smartdocs template?

I am trying to do something like this

Handlebars.registerHelper('equal', function(lvalue, rvalue, options) {
    if (arguments.length < 3)
        throw new Error("Handlebars Helper equal needs 2 parameters");
    if( lvalue!=rvalue ) {
        return options.inverse(this);
    } else {
        return options.fn(this);
    }
});
Solved Solved
0 2 314
1 ACCEPTED SOLUTION

As far as I know, you cannot register Handlebars helpers in SmartDocs templates. You may be able to include some JavaScript to be executed by the client if you're looking to apply logic to inputs.

View solution in original post

2 REPLIES 2

As far as I know, you cannot register Handlebars helpers in SmartDocs templates. You may be able to include some JavaScript to be executed by the client if you're looking to apply logic to inputs.

To clarify: while it is not possible to register a helper from within the template itself, it is absolutely possible for people to register Handlebars helpers from within a additional Javascript module that augments the builtin smartdocs JS.