Jump to:

3439 Posts in 1028 Topics by 869 members

Template Questions

SilverStripe Forums » Template Questions » $ThemeDir doesn't work in javascript require

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

Page: 1
Go to End
Author Topic: 236 Views
  • thany
    Avatar
    Community Member
    6 Posts

    $ThemeDir doesn't work in javascript require Link to this post

    I have this code:

    <% require javascript("$themeDir/javascript/bl.js") %>


    Doesn't work. Nothing gets included.

    If I replace the $themeDir by the actual themedir, e.g. "themes/themename", then it does work. This also works:

    <script src="$ThemeDir/javascript/bl.js"></script>


    Why not in a require?

    236 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.