Build UI
Templates Customizations

Set Custom Helpers

3min
occasionally, there are requirements to add your own helper functions to the klevu templates these helper functions can be used to reference local configurations, or modify existing klevu template functions to meet specific requirements set the helper function assign custom helpers using sethelpers within the klevu options object using the following format sethelpers { &#x9; "\<scope identifier(s)>" { &#x9; myhelpername \<function()> } &#x9;} e g klevu({ &#x9;theme { &#x9; sethelpers { "all" { helloklevu function(){ return 'hello klevu!' } }, "recs,quick" { myhelper function(){} } } &#x9;} }); call the helper function reference helpers within a klevu template \<script type="template/klevu" id="anyklevutemplate" > \<span style="color red;"><%= helper helloklevu() %>\</span> \</script>