By extending the View File from an entry point file of an extension, you can transfer a new variable to the associated template file.
Sample code shown below
_.extend(HeaderMiniCartItemCellView.prototype, {
getContext: _.wrap(HeaderMiniCartItemCellView.prototype.getContext, function (fn) {
var context = fn.apply(this, _.toArray(arguments).slice(1));
var isLoggedIn = ProfileModel.getInstance().get('isLoggedIn') === 'T';
context.rate_formatted = this.model.get('rate_formatted')
context.isLoggedIn = isLoggedIn;
return context;
})
}),