node.js - include into if with nunjucks in nodejs -


i working on user's system nodejs. used express , nunjucks. trying render template when user logged site , anoter template when user logoff.

{% if isloging %}         {% include "toolbar_guest.html" %} {% else %}         {% include "toolbar_guest.html" %} {% endif %} 

but not working... if try this:

{% if isloging %}         connected {% else %}     not connected! {% endif %} 

its work..

{% include 'toolbar_user.html' if islogging else 'toolbar_guest.html' %} 

Comments

Popular posts from this blog

javascript - Knockout pushing observable and computed data to an observable array -

'hasOwnProperty' in javascript -

Trouble making a JSON string -