New variable to Menu Manager node
Posted: Wed Aug 16, 2006 12:00 pm
Hello guys, I want to tell you that your piece of software over here is really nice. It's even better than my commercial CMS
. I was playing with Menu Manager today and I wanted to list simply links to pages that have same parent as current page (=sisters). I think it was way too big hassle with Smarty templates since I had to check depth and record parent so I slightly modified MenuManager::FillNode().
old code:
new code:
Then asking only sisters should be more simple.
Keep up the good work with the CMS,
Rallu

old code:
Code: Select all
// snip... //
$onenode->parent = false;
$count++;
if (isset($gCms->variables['content_id']) && $onenode->id == $gCms->variables['content_id'])
$onenode->current = true;
else
{
$onenode->current = false;
//So, it's not current. Lets check to see if it's a direct parent
if (strstr($gCms->variables["friendly_position"] . '.', $content->Hierarchy() . '.') == $gCms->variables["friendly_position"] . '.')
{
$onenode->parent = true;
}
}
// snip... //
Code: Select all
// snip... //
$onenode->parent = false;
$onenode->sister = false;
$count++;
if (isset($gCms->variables['content_id']) && $onenode->id == $gCms->variables['content_id'])
$onenode->current = true;
else
{
$onenode->current = false;
//So, it's not current. Lets check to see if it's a direct parent
if (strstr($gCms->variables["friendly_position"] . '.', $content->Hierarchy() . '.') == $gCms->variables["friendly_position"] . '.')
{
$onenode->parent = true;
}
//If it is not current or parent then it might be sister...
else if (substr($gCms->variables["friendly_position"], 0, -2) == substr($content->Hierarchy(), 0, -2))
{
$onenode->sister = true;
}
}
// snip... //
Keep up the good work with the CMS,
Rallu