Tamplate Language — Nosto Community

Tamplate Language

debug_gurudebug_guru Posts: 13Member

Which type of programming language does Nosto templates uses.?

Is there any reference or guide related to that?

If I want to perform any split or replace functionality how do I do that? 

Deepak Gurung


  • JacopoJacopo Posts: 41Walking Wisdom, Coding Expert admin
    Hello @debug_guru

    the templating language we use is Apache Velocity, and yes, the Internet is full of guides and how-to.

    But, since you asked, here how you can perform the two operations you have pointed out:


    #set($mystring = $!product.price.toString().replace("€","$"))
    ## this replace in every price the € symbol with the $ symbol. Everything before being
    ## replaced needs to be converted into string


    #set($mysplit = $!product.name.split("\&"))
    ## this generates an array called $mysplit with as many elements inside as the & that are found
    ## in the string- those are used in the template like $mysplit[0] $mysplit[1] etc.
    ## for knowing how many elements there are in the templates you can do $mysplit.size()

    Hope this will help :)
  • MaximeMaxime Posts: 10Walking Wisdom admin
    Hi @debug_guru,

    We have some documentation that you can check here as well. 

    Best. :)
Sign In or Register to comment.

Read our Terms&Conditions before commenting and posting