Adding Object to Partials Antlers?

Hi all,

I'm refactoring my code and trying to minimize the repetitive codes - so using partials seem like a great idea.

But how can I pass objects to partials? For example, I have a multiple assets names "gallery1" and other have "gallery2".
something like.. {{ partial:banner-slider slider=gallery1 }} or {{ partial:banner-slider slider=gallery2 }}

page.antlers.html

{{ partial:banner-slider slider=" PASS THE WHOLE OBJECT ??? " }}

_banner-slider.antlers.html:

<div class="banner-slider">
    {{ slider }}
    <div class="banner-slider__single fade">
        <img src="{{ url }}" alt="{{ if alt }}{{ alt }}{{ else }}{{ page:title }} banner image{{ /if }}">
    </div>
    {{ /slider }}
    <div class="banner-slider__arrows">
        <span class="prev">&#10094;</span>
        <span class="next">&#10095;</span>
    </div>
    <div class="banner-slider__dots">
        {{ slider }}
        <span data-dot-index={{ index }}></span>
        {{ /slider }}
    </div>
</div>
Answered by Grace Cho!
>>>>>>> Answered <<<<<<<
2 Replies
2 Followers