basickarl
basickarl

Reputation: 40464

How to display handlebars variable inside html code style?

I've been trying to do the following in my .hbs file:

<div class="nav-avatar" style="background-image: url('\{{ url }}avatar/\{{ user.pic }}');"></div>

However the CSS when looking through the website looks as so:

<div class="nav-avatar" style="background-image: url('avatar/');"></div>

Both {{ url }} and {{ user.pic }} display as they should otherwise.

Upvotes: 0

Views: 1782

Answers (1)

basickarl
basickarl

Reputation: 40464

I over complicated the problem. Didn't need to escape it.

<div class="nav-avatar" style="background-image: url('{{ url }}avatar/{{ user.pic }}');"></div>

Upvotes: 1

Related Questions