Jump to:

3397 Posts in 978 Topics by 854 members

Template Questions

SilverStripe Forums » Template Questions » literal dollar sign in template

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2302 Views
  • jester12345
    Avatar
    Community Member
    8 Posts

    literal dollar sign in template Link to this post

    What is the right way to include a literal dollar sign in a template?

    I've got some JavaScript, and "$f" is getting parsed out to nothing... kind of annoying.

    I tried escaping the dollar sign to no avail. Ultimately I wrote a "DollarSign" function in the Page model that simply returns a literal dollar sign. So in the template "{$DollarSign}f" gets me what I need. It just seems so inelegant.

  • Ben Gribaudo
    Avatar
    Community Member
    181 Posts

    Re: literal dollar sign in template Link to this post

    Hum...I'm not recalling any way to escape the dollar sign using the current template parsing engine.

    The template parsing patch I submitted implements escaping, such that template code "$$Something" will be output as a literal "$Something".

    Ben

    2302 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.