Hi,
I've created a client and a server template helper that has been correctly registered for both server and client side use. I'm able to see logging messages showing the the methods are being called both on client and server template renders. However, I don't seem to be able to pass any parameters into the functions.
Am I using the right syntax to embed my template helper?
In the template, I've tried a few ways to call the template helper without luck:
<img src="{function.someHelperFunction, someAvailableObject.subObject.value}">
<img src="{function.someHelperFunction, someAvailableObject}">
Server Side template helper:
templates.registerHelper('someHelperFunction', function(value) {
winston.verbose("value: ", value);
return "http://someurl.com/?zipper=" + value;
});
Client Side template helper:
templates.registerHelper('someHelperFunction', function(value) {
console.log("value: ", value);
return "http://someurl.com/?zipper=" + value;
});
In both cases "value" is undefined. Any ideas? What am I doing wrong?
FYI:
I'm running NodeBB 1.1.2, and I've used both of these threads as examples on creating template helpers:
https://community.nodebb.org/topic/3554/how-to-create-and-use-a-template-helper
https://community.nodebb.org/topic/6020/theme-conditional-target-xth-post/3