Views
Replies
Total Likes
What release of Communities do you have? For AEM 6.2, you need at least FP1.
I would recommend figuring out what is the issue you're having with client libs.
If you edit /etc/clientlibs/social/commons/scf/helpers.js, it could be overwritten in a future release.
The more details you could provide, the better.
- JK
Views
Replies
Total Likes
JK Kendall wrote...
What release of Communities do you have? For AEM 6.2, you need at least FP1.
I would recommend figuring out what is the issue you're having with client libs.
If you edit /etc/clientlibs/social/commons/scf/helpers.js, it could be overwritten in a future release.
The more details you could provide, the better.
- JK
We have a buddy drop from Adobe. I added a helper in the helpers.js called equalsNuts and it doesn't recognize it. That's the only change I made. Is there something else that needs to be done to register the helper other than just adding it to the JS file. I get the following error.
Cannot serve request to /content/sites/adls-resources/en/discussions.html on this server
Views
Replies
Total Likes
This is what I added, basically a copy of equals and changed the name, this is for a POC so it's ok the modify the helpers.js directly.
Handlebars.registerHelper("equalsNuts", 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);
}
});
Views
Replies
Total Likes
You need to register same helper on server side in java code as well. Follow https://docs.adobe.com/docs/en/aem/6-2/develop/communities/scf/handlebars-helpers.html#Server-side Custom Helpers
Views
Replies
Total Likes
Ok, so when do you know if you need to register it server side or not?
"While not required, it is recommended that custom helpers be implemented on the server-side as well as the client-side. For SCF, most templates are compiled and rendered on the server-side as the server generates the HTML for a given component when the page is requested."
Views
Replies
Total Likes
One other question, if I create a custom handlebars helper, does it need to be created server side as well in an OSGi bundle or will client side only suffice?
Views
Replies
Total Likes
schmidtkevina wrote...
One other question, if I create a custom handlebars helper, does it need to be created server side as well in an OSGi bundle or will client side only suffice?
Yes, the documentation has been corrected. It now reads :
"Custom helpers must be implemented on the server-side as well as the client-side, especially when passing data. For SCF, most templates are compiled and rendered on the server-side as the server generates the HTML for a given component when the page is requested."
- JK
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies