Type error when attempting to use repeat modifier.

New to statamic and loving it so far.

Im trying to use the repeat modifier with a {{ rating }} variable to display the relevant number of stars. Im defining the star in a yaml block at the top of the template, so something like this:

star: //star html here //

{{ view:star | repeat:rating }}

This is throwing this error: TypeError str_repeat(): Argument #2 ($times) must be of type int, Statamic\Fields\Value given

The {{ rating }} variable is an integer field so should definitely work. What am i missing?

>>>>>>> Unanswered <<<<<<<
2 Replies
2 Followers