Menu icon Foundation
Panini Question: how to use data in an ifEqual conditional

I've been building an HTML prototype with Panini which is great but I want to display certain elements based on what the value of data is.

So say I have a variable "number", how can I show if number == 3 then ...

I've tried

{{#ifEqual this.number == 2}}

{{#ifEqual number== 2}}

{{#ifEqual this.data.number == 2 }}

paniniHandlebarsconditionals

I've been building an HTML prototype with Panini which is great but I want to display certain elements based on what the value of data is.

So say I have a variable "number", how can I show if number == 3 then ...

I've tried

{{#ifEqual this.number == 2}}

{{#ifEqual number== 2}}

{{#ifEqual this.data.number == 2 }}
Rafi Benkual 3 months ago

Have an example of using this in this lesson: http://zurb.com/university/lessons/advanced-panini-tips-and-tricks

See creating component types

Andrew Cetnarskyj 3 months ago

Thanks I'll give it a try.