0

I have this:

{{#items}}
  .ts-{{name}} { background-position: sprite_position_percentage( {{px.offset_x}}, {{px.offset_y}} ) }
{{/items}}

How can I lowecase the name variable?

I tried {{name.toLowerCase()}} but the output produced was missing the name parameter: .ts- { background-pos...

aaandre
  • 2,502
  • 5
  • 33
  • 46
  • 1
    A good method is described in [this answer](http://stackoverflow.com/a/19836418/2008500) – jdegens Apr 02 '15 at 01:32
  • I am very new to handlebars, and am not sure how exactly they're wired with grunt spritesmith... where would the code defining the helper go? In the template itself? – aaandre Apr 02 '15 at 05:50
  • Yes helpers can be defined in the template. Check out [this example template](http://runnable.com/Ulhy_Hlb3_EeAAAW/how-to-use-custom-helpers-methods-handlebars-js-for-javascript-and-jquery). Basically just wrap the helper in a script tag. – jdegens Apr 02 '15 at 11:36

0 Answers0