Suggestion: Add an example to wiki #179

Closed
gmills82 opened this Issue Oct 16, 2012 · 2 comments

3 participants

@gmills82

I tried to fork just the wiki repo but apparently github doesn't allow you to do pull requests on just the wiki documentation. They should really do that.

Anyway, I ran into a frustrating use of array contexts today and wanted to share so that no one else goes through it.

In this code, {@if cond="{skuGroups.length} > 3"} skuGroups is an array located in my current context.

When I tried {@if cond="\'{skuGroups}.length\' > 3"} which is similar to some of the other if examples on the wiki, it didn't work. It did however work for a coworker of mine if skuGroups is a string.

I had to use {@if cond="{skuGroups.length} > 3"} this syntax for the array version. Which really makes sense if you think about it in terms of contexts and paths. I mean the length attribute is available at that level and accesible through the dot syntax.

So I think it would be helpful if you mention that in the Dust tutorial wiki. I would add it myself if I code.

Thoroughly enjoying all the great docs and development around this project. Keep up the good work!

@jairodemorais

@gmills82 thanks for the suggestion. we will add this example ASAP.

@vybs

@gmills82 we have really deprecated the use of if helper for many other reasons.
linkedin/dustjs-helpers#13

@vybs vybs closed this Feb 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment