Questions tagged [express-handlebars]

474 questions
2
votes
1 answer

Dynamic property query in handlebars

I am trying to get a property of an object in handlebars dynamically dependent upon the pid that the #each loop is currently on. I have tried the following code but the value isn't getting populated at all. I'm imagining there's some sort of context…
drcomputer
  • 406
  • 2
  • 7
  • 15
2
votes
1 answer

Handlebars and Looping Through JSON Objects

Mind if I ask for some advice on how to loop through the follow JSON objects please and put it into a Handlebars template? I've found a lot of similar questions here for "Handlebars and looping through JSON", but after quite a few hours of reading &…
christo
  • 127
  • 1
  • 2
  • 12
2
votes
1 answer

Handlebars access outer index in nested loop

Say I have the following code:
{{#each questions}}
{{#each this.answers}}
{{this}}
{{/each}}
{{/each}
How can I access the…
Markus Meskanen
  • 19,939
  • 18
  • 80
  • 119
2
votes
0 answers

How to add header and footer to the design using express-handlebars in node.js

I have an issue regarding the rendering of other template on the existing one. Let's say I have some design. So on main.handlebars I have wrote the Header and footer html. {{title}} ....…
Ankit
  • 951
  • 1
  • 9
  • 29
2
votes
1 answer

Multiple views folders with Express and Handlebars

I need to register multiple views folders using Express and express-handlebars. Is it posible? I have this structure: /project/ /admin/ /views/ /server/ /webapp/ /views/ /server/ /common/ …
2
votes
0 answers

How to load handlebars template after building with webpack from dist folder?

I'm building a single page node app with express and handlebars but i'm new to node and got stuck while building the handlebars with webpack. My folder structure is like this : https://i.stack.imgur.com/sKQVd.jpg I'm using…
2
votes
1 answer

How to pass a function to express-handlebars in nodejs-express?

I am trying to pass a function in express-handlebar, but it is not working. I am using app.js as server file and index.handlebars as handlebar file. app.js const express=require('express'); const app=express(); const…
2
votes
3 answers

Sending email with nodemailer and handlebars

I want to send an email using Nodemailer and Handlebars but I can't use a dynamic template. Here is my setup. template is the template name and it looks like sign-up-mail-template Now when I send this email I will receive Error: ENOENT: no such file…
Markus Hayner
  • 2,869
  • 2
  • 28
  • 60
2
votes
1 answer

Copy to Clipboard in NodeJs with Express Handlebars template engine

How we can implement copy to clipboard feature on button click in NodeJs using express handlebar template. I have tried using Javascript but it's not working. Below is the code which I have tried: myFile.handlebars :
Zarna Borda
  • 695
  • 1
  • 6
  • 22
2
votes
2 answers

Refresh page automatically when MongoDB collection changes

I'm making a Node.Js with MongoDB application and I need to refresh one of my HBS pages every time something changes on my MongoDB collection. Don't know exactly what I should do. What is the best approach to do so? Cheers.
Paulo Lima
  • 168
  • 1
  • 2
  • 12
2
votes
2 answers

express-handlebars template not loading CSS styling on static routes

I have a set of different routes all using the same template main, but any route is only one / away from the base route applies the CSS but anything beyond that will not include it. So app.get('/profile) will render with the CSS, but…
J T
  • 77
  • 1
  • 1
  • 11
2
votes
1 answer

Specify layout in res.render() while also feeding it data

I have this code: res.status(200).render('body_loggedin', usernameDocs[0]); to render the data from usernamedocs[0] into the 'body_loggedin' view but I don't want it to to have the main layout. Every answer to similar questions doesn't address…
Danjuro
  • 141
  • 1
  • 8
2
votes
0 answers

Express Handlebars - adding unique stylesheets and scripts to different pages' s

I'm trying to add content into the head tags of my handlebars layout but haven't figured out a way to make it work. Basically I just want to be able to add links to stylesheets or javascript files on particular pages, not site-wide. I've tried…
jbaumann
  • 181
  • 6
2
votes
1 answer

Sending template email with nodemailer, broken styles

trying to send a template email using nodemailer and making the template with handlebars. The email does send but the styling of the email is not right. It looks like this I have attached what I've written in my handlebars template
Shaun Chua
  • 705
  • 3
  • 13
  • 32
2
votes
0 answers

if statement: Cannot get partial to render

I am writing an application that displays a different image in the browser based on user data. The back end works fine: I'm getting the proper user data to store in the cookie. Here is what the hbs view looks like:
HuhWut
  • 21
  • 1
1 2
3
31 32