I am trying to create a custom collection template, which includes some of my custom fields.
This is what I have at the moment: https://gist.github.com/adrigen/06bdc88bda6e9cf20a44
But the error is: NameError: name 'resource_type' is not defined.
I know I need to define that variable, but I cant find the right place to do it.
I tried
<metal:block use-macro="context/standard_view/macros/entries"
tal:define="
resource_type context/resource_type; >
And a few other places, but it doesn't seem to make a difference. What am I understanding incorrectly?
I moved the definition to
<div class="icon" tal:define="...">
as per Mathias' suggestion.Then got the error
And noticed that 'context' refers to the collection while item is an object, so I changed it to
tal:define=" resource_type item/resource_type;
And now it's good.