Question

How to add sctipts in freshservice portal

  • 20 March 2023
  • 2 replies
  • 118 views

I can’t able to get normal document ID on script. I think in new version, you guys using handlebarjs and emberjs..

 

How do we customize using script in portal?


2 replies

Userlevel 1
Badge +5

I am also having a lot of trouble customizing the new portal that I didn’t have with the old one. It seems the new syntax doesn’t allow logic in an if statement, so I can’t say something like


{% if portal.user.job_title != null%}

like I could in the past. The new format appears to be {{#if}}, but it doesn’t allow logic, only true/false returns.

 

From what I could find researching you can create your own logic using Handlebar Registered Helpers such as:

Handlebars.registerHelper("equals", function(string1 ,string2, options) {
if (string1 === string2) {
return options.fn(this);
} else {
return options.inverse(this);
}
});

but I can’t find a file where registering the helper actually works from within the portal customization section.

 

As of this time I have significantly less power to customize the portal than I did on v1.

Userlevel 5
Badge +5

Hi @Rino 

Hope you are well, 

Could you elaborate more on the issue? Does it throw an error, Something like "scripting is disabled" for your Portal? You can reach out to support@freshservice.com so that we can enable the Customization for your Portal. Let me know if you have any queries! 

Reply