I created a component to display the menu_data() array. I have three pages defined, all are on the menu and none are private. Also, I'm using PRETTYURLS. When I call it without params, it returns one array element for the index file. If I call it with a slug, it returns that slug's page info (as advertised), but its not returning ALL menu items.
I suspect its in this area, perhaps something to do with setting the slug to '' when the slug = 'index'... but not sure. Could someone take a look? Thanks.
Update and Fix: I believe a suitable fix is;
This works for me.
Code:
if ($PRETTYURLS == '1') {
if ($parent != '') {$parent = $parent."/"; }
if ($slug == 'index' ) { $slug = ''; }
$url = $SITEURL . @$parent . $slug;
} else {
$url = $SITEURL .'index.php?id='.$slug;
}
$specific = array("slug"=>$slug,"url"=>$url,"parent_slug"=>$parent,"title"=>$title,"menu_priority"=>$pri,"menu_text"=>$text);
if ($id == $slug) {
return $specific; exit;
} else {
$menu_extract[] = $specific;
}
I suspect its in this area, perhaps something to do with setting the slug to '' when the slug = 'index'... but not sure. Could someone take a look? Thanks.
Update and Fix: I believe a suitable fix is;
Code:
// if ($slug == 'index' ) { $slug = ''; }
$url = $SITEURL . @$parent . (($slug == 'index') ? '' : $slug);
This works for me.