0

Why am I getting this error:

org.apache.velocity.exception.ParseErrorException: Encountered "btnBreakPrivateStartDisabled" at /templates/przerwy/askbreaks.vm[line 14, column 97]
Was expecting:
"(" ...

when using this:

<input type="button" id="button_break_private_start" class="breakButtons"
{{#if btnBreakPrivateStartDisabled}}disabled{{/if}}
value="$action.getText('break.ask.private')"
onclick="window.location.href='$req.contextPath/plugins/requests/requestprivatebreak.action'"/>
Scott Dudley
  • 3,256
  • 1
  • 18
  • 30
user3856632
  • 29
  • 1
  • 4

1 Answers1

2

The #if is being interpreted as a Velocity directive, and since parentheses are required around the conditional expression in Velocity syntax, it produces the error you see above. Your syntax suggests that you meant for that #if directive to be processed by Handlebars instead. It's not clear how you are invoking Handlebars, but if you need to represent a literal #if in your output, you can escape the #.

Note that Confluence has built in support for Soy templates (Google Closure templates). If those might fit your need in place of Handlebars, they would allow you to write .soy templates directly without having to go through Velocity and without worrying about escaping.

Community
  • 1
  • 1
Scott Dudley
  • 3,256
  • 1
  • 18
  • 30