Can view functions be used in Mustache?

Can view functions, like portal.assetUrl, be used in mustache templates?


That should be possible by just using the Mustache format for adding data from the Controller.
I haven’t used Mustache but it might be as easy as using {{portal:assetUrl(whatnot)}} in your code.

This is the setup for the controller:

I’ve invited a few other developers here that might know more.

Hi Helge!

There’s currently no portal functions in Mustache. You need to create the urls in your controller and pass them to Mustache. The documentation for 6.0 will be clearer on this.


1 Like

Reason for this is that Mustache is “logic less” - so everything must be passed in with the model. We’re investigating if we can get around this somehow for the portal functions - @srs knows more on this.