Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

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 365
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