Menu icon Foundation
Custom panini helpers

Hi,

I'd like to create a custom handlebars Panini helper similarly to how "#ifequal" works, but for sections instead.

For example, I want to include some json data content into section A, then a different data content into section B, both on the same page.

How can I go about writing my JS file to do so?

sitescustom helpershelperspaninisectionifequal

Hi,

I'd like to create a custom handlebars Panini helper similarly to how "#ifequal" works, but for sections instead.

For example, I want to include some json data content into section A, then a different data content into section B, both on the same page.

How can I go about writing my JS file to do so?

Rafi Benkual 11 months ago

Not sure how to do that but you can create separate data variables for the content and new objects for each block.

Sensaetions 11 months ago

Thanks Rafi for the reply. I would like to keep the data variables in a single file (especially since the data content are of the same type). I have used the #ifpage helper and see that it's written like so on this page: https://github.com/zurb/panini/blob/master/helpers/ifPage.js

I know that there's #ifequal helper as well, but that doesn't seem to work to look for css classes. I'm curious if this example can be written into a custom handelbars helper to look for <section> tags or use css classes? Can you provide an example of how this could work or be written?

 

Hadwin 4 months ago

I recommend only good and reliable information, so see it:  Lavender Tea

Nickwick 3 months ago

Thank you for sharing your post with us.I really liked it.Please check out my website mywifiext.net Genie Setup and like comment and share what you feel and also take benefits of our services if you want or your need.

Jindo 3 months ago

 Thanks to the author for the article! Very pleased!

   ludo king

Antoniacummins 3 months ago

Thanks