09:49:55 <Kaimane> Using {v:iterator.filter(subject: '{Vehicle.Equipments}', filter: '3', propertyName: 'CategoryId')} but output is still "Array". My goal is to get all items of {Vehicle.Equipments} where CategoryId is 3: {Vehicle.Equipments.x.CategoryId}. But why do I get "Array"?`
09:56:36 <NamelessCoder> Kaimane what would you expect f:iterator.filter to return, if not a filtered version of the input array? If you try to output an array directly in Fluid, it will just write "Array"
09:58:42 <Kaimane> NamelessCoder: I expect a filtered version ;-) But how to work with that output "Array"?
09:58:43 <NamelessCoder> you have to use that expression somewhere that an array is expected, like in <f:for each="{array -> v:iterator.filter(...)}">
10:00:13 <NamelessCoder> and you can of course <f:debug> it. But outputting it as a string will not work.
10:00:46 <Kaimane> Namelesscoder: <f:debug> does not work. It also outputs "array".
10:01:27 <NamelessCoder> then you have some spaces around the value
10:02:17 <NamelessCoder> <f:debug>{variable}</f:debug> debugs {variable. <f:debug>{variable} </f:debug> debugs {variable} as cast to a TextNode inside f:debug because it has text.
10:02:48 <Kaimane> Okay. My fault. That does the trick: {v:iterator.filter(subject: '{Vehicle.Equipments}', filter: '3', propertyName: 'CategoryId') -> f:debug()}
10:03:25 <NamelessCoder> your ideal expression, following all rules, might look like: {vehicle.equipments -> v:iterator.filter(filter: '3', propertyName: 'CategoryId') -> f:debug()}. Your variables are a bit oddly named
10:03:47 <NamelessCoder> and by the way you never need to do '{variable}' *especially* when the variable is not a string.
10:04:17 <NamelessCoder> {v:iterator(subject: vehicle.equipments)} is the same but does not try to create an additional TextNode
10:31:49 <Kaimane> NamelessCoder: Thank you very much for your support. Now it works as expected!
10:33:57 <Kaimane> But there is another question: I use <f:alias map="{categories: {1: 'Kategorie 1', 2: 'Kategorie 2', 3: 'Kategorie 3'}}"></f:alias> and would like to output {categories.{i.cycle}} within the <f:alias> tag but fluid does not render the string. How to use an interator within a variable?
10:35:46 <NamelessCoder> check the "Dynamic variable access" example on https://fluidtypo3.org/library/try-fluid-now.html
11:03:39 <Kaimane> NamelessCoder: Okay, I have to use <v:variable.get/>. Works like a charm ;-)
11:07:13 <Kaimane> Third and last question for today ... Is there a possibility to check if an array is empty? <f:if> does not the trick if the condition is {array} == ''. <f:debug> prints array(empty).
11:10:39 <NamelessCoder> that's the most efficient way you can check any array/iterator ;)
11:23:46 <Denyerec> NamelessCoder, if I want to checkout an extension based on its tag it's "git checkout 3.0.0" right ?
11:24:05 <Denyerec> This gives the me "You are in detatched HEAD" state, but that's OK if I'm just consuming the extension and not developing it, right ?
11:26:38 <NamelessCoder> if you have all the tags locally then yep. However, it should create a new branch for you - so I think you may not have all the tags