I believe that I was in error with the following line of code:
#set ($selected = $page.isSelected($selectable, $page, $request.getAncestorPlid()))
The $request variable has no getAncestorPlid() method to invoke.
But I am still at a loss as to how to get the selected state to work.
Since, in my example, the $page variable is a layout object that is being iterated over, I am assuming (perhaps incorrectly) that the isSelected method (from LayoutImpl.java) can be invoked on the variable.
And if it can, then it is a matter of passing in the correct parameters to determine if the current page is "selected"
I updated the code to the following:
1 #set ($selected = $page.isSelected($selectable, $layout, $layout.getAncestorPlid()))
2 #if ($selected)
3 <li class="selected">
4 #else
5 <li>
I pass in $layout (found in init.vm) and its ancestor plid method. I also pass in the $selectable variable (also in init.vm), but it is not working.
Any guidance at all would be appreciated, as I am not any closer to a useful result.
Regards,
--Chris