jehugaleahsa / mustache-sharp

An extension of the mustache text template engine for .NET.
The Unlicense
306 stars 78 forks source link

Has anyone done a fallback placeholder? #59

Open oscaruribe opened 8 years ago

oscaruribe commented 8 years ago

Has anyone done a quick tag for fallbacks? Instead of writing

{{#if Name}} {{Name}} {{else}}Fallback{{/if}}

I'd want to write: {{Name, ifnull=Fallback}}

If anyone has done anything like it I would really appreciate some code for it!

In return here's a URLEncode placeholder: https://gist.github.com/oscaruribe/b82aa3e1e78a62a707d5 Usage {{#urlencode Name}} good for putting in URL when passing data!