I'm new to Silverstripe. I am bit struggling with its templating scheme.
Basically this code:
<% control Page %>
<% control Children.GroupBy(Category) %>
$PageName . " - cat " . $Category . " - " . $Counter
<% end_control %>
<% end_control %>
If we have 6 page, 2 category (3 each). Then with function $Counter { return $this->iteratorPos } on page controller. Above code will ouput:
Page 1 - cat 1 - 1
Page 2 - cat 1 - 2
Page 3 - cat 1 - 3
Page 4 - cat 2 - 1
Page 5 - cat 2 - 2
Page 6 - cat 2 - 3
The counter takes into account the 'Group By' on control. Is there anyway to bypass this?
I would like a counter that returns 1 to 6 instead.
Thanks in advance.