TangibleInc / template-system

A template system for WordPress with content type loops and conditions
https://docs.loopsandlogic.com/reference/template-system/
8 stars 3 forks source link

Loop `count` attribute not working on list loop type #81

Closed BenTangible closed 7 months ago

BenTangible commented 8 months ago

Unless I was mistaken when I wrote the section of the docs on loop attributes, "attributes can be used for all loop types to modify the output of a loop."

If that's true (or supposed to be true), then I just noticed a bug whereby the count attribute doesn't do anything when used on a list loop.

<List numbers>
  <Item>One</Item>
  <Item>Two</Item>
  <Item>Three</Item>
  <Item>Four</Item>
  <Item>Five</Item>
</List>

<ul>
  <Loop list="numbers" count="3">
    <li><Field /></li>
  </Loop>
</ul>

Result:

  • One
  • Two
  • Three
  • Four
  • Five
eliot-akira commented 7 months ago

Solved in https://github.com/TangibleInc/template-system/commit/c98ac106f0a6653fa50a37933693aa284de7c4a2