Newest 'dust-helpers' Questions

Q&A for professional and enthusiast programmers

compare multiple JSON keys against same value in dust templates

I have a JSON being passed to a Dust template and want to compare multiple keys for the same value. For example I have a JSON like: "data": { "abc": "true", "xyz": "true", "uno": "...

Using the dustmotes-if helper

I am loading (via requirejs) (the latest versions of) dust and dust-helpers in the following way define.amd.dust = true; require(["./Scripts/dust-full"], function (dust) { require(["./Scripts/...

DustJS: Render partial via a Helper

I'm trying to abstract some code and would like to take advantage of dust.helpers to render a parial. My current setup: {> "includes/components/link" /} My ideal setup: {@uiComponent name="link"...

dustjs OR condition over multiple parameters

I have an object with multiple properties viz propA, propB propC and propD. I want to write a condition with OR checking more than one parameter like below. {@if cond="'{obj.propA}'.length > 0 ...

How to use dustjs-helpers with grunt-dust?

I'm using grunt-dust to compile dustjs templates, but now I've run into the problem that I need to use dust helpers (like @eq) which apparently grunt-dust ignores completly. I've installed dustjs-...

What would be a good approach for providing d3 capability in a dust-helper?

Right now I've been considering writing a dust-helper that renders barcharts into dust files server-side using a custom dust-helper and the d3 module for node. I was wondering if there was a better ...

How to run or condition in Dust template

I am using "dustjs-helpers": "1.6.0", with "dustjs-linkedin": "^2.6.0" . In my template I need to check an OR condition like if( cherry === true || berry === true) path/to/template1/ else path/...

Use node module in typescript enviroment

I've been trying to use the node modules 'markdown' and 'dustjs-helpers' in my angular 2.0 client side. The thing is that I couldn't reach a solution using typings (both packages are not available on ...

Function call and checking results in DustJs

I am combining connect-roles with dust template ejs template have something like this syntax <% if (userCan('impersonate')) { %> <button id="impersonate">Impersonate</button> <%...

How to hide and display content in a dust template?

I am a rookie in nodejs. I am making an e-commerce site using kraken framework and dust template. I want to display Log in and Log out text depending upon the session status. My logout and login ...

Can we implement if and else condition inside dust partial

Some thing Like below {>partial {?if} conditions {:else} conditions {/if} /} I have implemented in above way but the complete code is directly printing on the web page

DustJS logic to verify empty string

I need to write logic to check whether the value is empty or it has string. Any help on this.. i tried this following. but it doesn't work in nodejs and throwing error {@if cond="'{notes}' != '' || '{...

Async Client Side Rendering React components using Dust JS Templates

I'm having a dust helper called {@component id="compId" path="path/to/react/component"}. About React component: The react component makes an ajax call in componentWillMount and calls forceUpdate. ...

Dust helper equal for select control

I have this template i need select proper selected option, how to compare it with dust helpers? http://en.stack.aiseen.org/a/19628029/880709 didn't work for me {#data.PRODUCT_TURNOVER_DATA} <tr> ...

Dustjs OR helper

How to write below statement using dust helper? {@eq key="device" value="windows || Linux"} Your system is Windows or Linux based. {:else} Your system is MAC based. {/eq}

Dust.js Template Custom Helper in Bootstrap Inconsistent Behaviour

I have a Dust.js helper where I apply some acl logic as follows: 'use strict'; import dust from 'dustjs-linkedin'; import acl from '../config/acl'; dust.helpers.accessControl = function(chunk, ...

Dust.js get call count of helper in template

So I have a dust.js helper which requires some jsx module when called and afterwards renders this module as html (some kind of plugin). {@react type="Text"\} ... <some Markup> ... {@react type="...
Translating... 0%