I really would appreciate just a little hint right now!
Could you point me to a description of the AutoNav block and its functions - I can't seem to find any technical description of it.
Short answer: The hasChildren() feature is non-functional, period.
Long answer: I ran find-in-files on the autonav block code, and AutonavBlockItem::hasChildren() is the only place where AutonavBlockItem::subNavigationItems is ever mentioned. It is neither defined in the class body nor assigned to anywhere in Concrete5 code. It is therefore always null, and so count() on it returns 0.
I managed to solve solve this by adding code to the controller to actually populate the subNavigationItems members in items.
Copy /concrete/blocks/autonav/controller.php to /blocks/autonav/controller.php and add this code in AutonavBlockController::generateNav() just before the return statement:
//initialize the subNavigationItems arrays in itemsforeach($this->navArrayas$k=>&$nav)$nav->subNavigationItems=array();//index items by collection id$idIndex=array();foreach($this->navArrayas$k=>&$nav)$idIndex[$nav->getCollectionObject()->getCollectionID()]=&$nav;//add children to parentsforeach($this->navArrayas$k=>&$nav)$idIndex[$nav->getCollectionObject()->getCollectionParentID()]->subNavigationItems[]=&$nav;
Code
Post Reply
Delete Post
You are allowed to delete your post for 5 minutes after it's posted.
Isn't there anybody that have a idea how to solve this.
Michael