leaf-kit icon indicating copy to clipboard operation
leaf-kit copied to clipboard

loop over custom tag result

Open Igor-Palaguta opened this issue 4 years ago • 2 comments

In Leaf 3 we could loop not just over arrays from context, but we also could loop over custom tag result

Now in Leaf 4:

  1. #for(language in #config("app", "languages")): Throws exception: LeafKit.LexerError.Reason.invalidParameterToken(\"#\")

  2. #for(language in config("app", "languages")): Throws: "for loops expect single expression, 'name in names'"

Igor-Palaguta avatar Nov 15 '20 16:11 Igor-Palaguta

I'm seeing the same issue with the Nodes Flash package. I was expecting to be able to use the following in my templates (where flashes() is the custom tag):

#for(flash in flashes().all):

#endfor

tonyarnold avatar Oct 03 '21 23:10 tonyarnold

@0xTim here you go, for the flashes library 🫡

ptoffy avatar Apr 24 '23 14:04 ptoffy