Using a passed in partial's variable within antlers syntax

Hey there.

I was wondering whether it's possible to pass in a value in a partial, e.g.:

{{ partial:partials/pagination paginationValue=4 cardType='blog-card'}}.

And then use the values within antlers syntax, like so:

{{ collection:blog paginate=paginationValue as="loop" }}


{{ loop }} {{ partial:partials/:cardType }} {{ /loop }}
{{ paginate }} <div> <a href="{{ prev_page }}">← Previous</a> <a href="{{ next_page }}">Next →</a> </div> {{ /paginate }} {{ /collection:blog }}


As you can see, I'd like to pass in the variables 'paginationValue' and 'cardType'. Is there a way to do this?

Thanks

Answered by Jack McDade!
>>>>>>> Answered <<<<<<<
3 Replies
3 Followers