New: Learn Statamic on Laracasts!

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 →

Looping inside slots - unexpected characters ouput

Lewis Tyler January 8, 2021 by Lewis Tyler

So I'm attempting to create a re-usable slider component where the slides are injected into {{ slot }} and I am seeing some unwanted characters coming through see here

My (simplified) antlers code

{{ partial
  src="components/slider" // Only works with src
  items="{{ items }}" // Doesn't work at all without this
}}
  {{ items }} // If I add as="posts" here it outputs slightly less chars (see second img)
    <li>
      {{ title }}
      {{ glide:featured_image width="400" height="400" }} // This doesn't seem to be causing the problem 
    </li>
  {{ /items }}
{{ /partial }}

Then the main component

<div class="slider">
  <ul>
    {{ slot }}
  </ul>
</div>
Answered by Lewis Tyler!
>>>>>>> Answered <<<<<<<
4 Replies
2 Followers