Questions tagged [handlebars.java]

Handlebars.java is a modern and full featured template engine and a java port of [handlebars]. It provides the power necessary to build semantic templates with the same syntax as [mustache]

64 questions
1
vote
0 answers

Switching feature in Handlebars Templates

So, we have created many templates using handlebars. Out of the many, we have one handlebar where we would like to make some changes that should only go live after a certain date. To do so, we wanted to create sort of a toggle switch, something…
1
vote
2 answers

How to do currency formatting in HandleBar in java?

Does handlebar support currency formatting? Something like below for instance? IDR{{amount}} SGD{{amount}}
Minisha
  • 2,117
  • 2
  • 25
  • 56
1
vote
1 answer

infinite loop detected, partial ../foo.mustache was previously loaded

Hi I have two handlebars templates which is as below. foo.mustache {{#if hasProperties}} {{>bar}} {{/if}}{{^hasProperties}}{{propsName}}{{/hasProperties}} bar.mustache {{#propertyObject}}{{>foo}}{{/propertyObject}} When I compile this and run,…
Imesh Chandrasiri
  • 5,558
  • 15
  • 60
  • 103
1
vote
3 answers

Literal braces in Handlebars template

I'm having difficulties including braces { } in a Handlebars template so that it didn't interfere with Handlebars syntax. Specifically, I want to have a template like this: {{{sometag}}} Except that I want the first and the last braces to be…
pvgoran
  • 442
  • 3
  • 14
1
vote
1 answer

Micronaut / handlebars helpers

I'am wondering where (or how) should I declare helpers for handlebars in my micronaut project ? I have tried following approach: public class Application { public static void main(String[] args) { Micronaut.run(Application.class); …
Fabrice V
  • 41
  • 5
1
vote
1 answer

Is there a way to use a standalone WireMock with Handlebars partials?

I would like to use handlebars partials in WireMock. Unfortunately I can't find a way to register those in the docs.
ehirsch
  • 13
  • 4
1
vote
6 answers

Handles Bars hbs is not a function

i have just set up my layouts folder inside view as app.engine('hbs', hbs({extname: 'hbs', defualtLayout : 'layout' , layoutDir: __dirname + '/views/layouts'})); app.set('views', path.join(__dirname, 'views')); app.set('view engine',…
Anis
  • 1,190
  • 2
  • 13
  • 26
1
vote
0 answers

Handlebars: Fetch parameter names

I want to know the name of the parameters that are in a template without having the helpers, I can't seem to find from neither Handlebars nor Template a natural way to do this. I had to do it manually but maybe I am missing how to do it? Handlebars…
imTachu
  • 3,759
  • 4
  • 29
  • 56
1
vote
1 answer

Resolve a virtual path within a Handlebars.java view for Spring MVC

I'm trying to hook up a Handlebars.java as a simple view engine for Spring MVC. I've added a Bean for the HandlebarsViewResolver and can get a view to render. What I'm trying to do now is resolve virtual paths in my views into absolute ones. For…
Paul Turner
  • 38,949
  • 15
  • 102
  • 166
1
vote
1 answer

Handlebar.java : Comparing equality in #if helpers

How can I compare equality and other logical conditions in Handlebars.java. For example: {{#if template_version == "v2" }} //do something {{ else }} //do something {{/if}} Solutions with or without registerHelper() are welcome.
Pratik Nagelia
  • 281
  • 1
  • 4
  • 14
1
vote
2 answers

Java: Passing multiple values to handlebar template

I am using handlebar templates to prepare email content dynamically before sending over it. It's straightforward to pass just one value. For example: What's up {{this}} template workes fine with template.apply(firstName). Tried changing the template…
Himanshu Yadav
  • 13,315
  • 46
  • 162
  • 291
1
vote
1 answer

Handlebars: Partials vs Helpers For Templating

We're starting to use Handlebars for the view layer in some of our projects. We are starting to hit a crossroads between two ways of doing some templating. I've been using partials to handle the templating & having small HTML templates like:
Lee Theobald
  • 8,461
  • 12
  • 49
  • 58
0
votes
1 answer

How to inject filed in JSON object using Handlebars in Wiremock response templating

Wiremock docker image: wiremock/wiremock:2.35.0. I am using docker image of Wiremock server, and I need to create a mock for custom response based on the request's body. Futhermore, I need to add a custom field in the response. Handlebars doesn't…
0
votes
0 answers

Handle bars interprets the number as a string and doesn't return the entire string instead it truncates when it has space in it

I am using Java 8 and Handlebars version 4.1.2. I am sending numbers as a string from UI and the handlebars are not returning the entire string in it. Here are the scenarios which are failing: Issue1: Numbers followed by space followed by text…
0
votes
1 answer

How to access nested object value with handlebar?

I'm new to handlebar and I'm trying to achieve something like this by passing treeMap to JSReport, but I can only get the map key and failed to get the map value. | Product Code | Product Name | Mon | Tue | Wed | Thur | Fri | Sat | Sun | |…