We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

A question regarding passing a variable into a partial (again)

James Hall November 28, 2020 by James Hall

Hey everybody,

I'm looping through a bunch of values, each of which has a respective icon, each of which use the naming syntax "icon-{value}". For example, if the loop outputs the value 'html', I'd like the file 'icon-html' to be called using a partial. I can't seem to find the correct syntax. Maybe there's a better way of doing this? Trying to keep it as short and sweet as possible.

{{ technology_stack as="loop" }}
        {{ loop }}
            {{ partial :src="partials/icons/icon-{value}"}}
        {{ /loop }}
{{ /technology_stack }}


Answered by Pfeifakopf!
>>>>>>> Answered <<<<<<<
4 Replies