Solved: start_level parameter in menumanager after upgrade 1.4.1 to 1.6.5
Posted: Sun Sep 06, 2009 5:43 pm
After upgrading from 1.4.1 to 1.6.5, all sites where I used the start_level parameter to show a second level menu in the left bar, were no longer showing the menu. In fact, as soon as I used the parameter start_level in a menu call, that menu disappeared.
Example of the code I used in my template
When looking at differences in action.default.php (in modules/MenuManager) between 1.4.1 and 1.6.5, I found that I could resolve the issue by taking out the if statement at line 98, reverting that portion to the 1.4.1 version
In fact, I have no clue what I have been doing here. As such, I would appreciate it if someone explained the necessity of this if-condition.
Example of the code I used in my template
Code: Select all
<div id="menu_vert">
{menu template='simple_navigation.tpl' start_level='2' number_of_levels='1' collapse='1'}
</div>
Code: Select all
$curcontent =& $curnode->GetContent();
// if( !$curcontent ) {
$properparentpos = $this->nthPos($curcontent->Hierarchy() . '.', '.', intval($params['start_level']) - 1);
if ($properparentpos > -1)
{
$prevdepth = intval($params['start_level']);
$rootnode =& $hm->getNodeByHierarchy(substr($curcontent->Hierarchy(), 0, $properparentpos));
}
// }