This is ported over from the GitHub issue tracker at http://github.com/ghing/menu_site_map/issues#issue/2.
Here is the initial bug report:
I enabled some nodes as menú items, being child of some sectors. I don't want those items to be shown on the regular menú, but I do want to see them in the sitemap. I disabled them in the menú item, but enable them in the sitemap but they are not shown.
If I enable them in the menu, they are shown. Your "Included in site map" checkbox is not forcing the hidden items to be shown, while it does hide items that are shown in the menú if I uncheck the "Included in site map"
checkbox.
And the discussion so far:
mairav September 29, 2009:
This is the only thing I have no clue of how has to be done.
ghing October 09, 2009:
I didn't anticipate needing this functionality, so this is something I hadn't looked at. A quick look at the code doesn't show any logic in the module that excludes hidden menu items. Perhaps hidden links are not included in the tree returned by the Drupal function menu_tree_all_data()? I will continue to look into adding this functionality.
ghing October 15, 2009:
I didn't see this bug testing on my Drupal instance. When I disabled a menu item it still showed up in the site map. I'm uploading a screencast showing this to clarify.
mairav October 15, 2009:
If I go to the sitemap page, the excluded items in the menu are not included in the sitemap, but if I go to the admin/settings/sitemap/menu_sitemap/select_links page, all menu items are shown, including those that are not enabled in the menu.
It would be great that in admin/settings/sitemap/menu_sitemap/select_links before the "Included in site map" you add a column with "included in menu" with a disabled checkbox that just shows that item status, so we now if the item is enabled or not.
With a "yes" or "no" will be fine too.
Just to clarify, with your module I can hide items that are originally shown in the menu, but can't show items that are hidden in the menu, even if I check the "Included in site map" option.
ghing October 15, 2009:
A screencast of how this is working for me: http://screenr.com/FTN
Comments
Comment #1
mairav commentedGhing, I found the problem.
What I want to do is exactly what you do in the screencast, but with a little difference. You are disabling a second level item, and I'm disabling a third level item.
If I transform in the menu, that third level item into a second level item, and keep it disabled, the item is hidden in the menu, but it's shown in the sitemap.
So it has something to do with the levels. Try disabling a third level item from the menu.
Comment #2
ghing commentedI haven't been able to replicate this on my test instance, even with a 3rd or 4th level menu item. If you can document your menu configuration somehow, that would help identify the differences between what you're seeing and what I'm seeing.
Comment #3
homebrewruss commentedI'm not sure if this is the same issue but I was having trouble generating a sitemap using the menu but also showing items that are excluded from the menu in the sitemap.
It seems the issue is not with the menu_tree_all_data() function but rather the menu_tree_output function.
The problem code is here:
commenting out the if statement surrounding $items[] = $data; would enable the full menu tree to be shown.
Probably best to copy the entire menu_tree_output function into your own module and then modify as i have done.
Comment #4
husumiao-1 commentedHello, man.
Actually, you don't need change the core function or use the new function for show all the menu items, include the hidden item of the all menus. you just need annotation two lines code for the site_map.module file, on 437 line.
function _site_map_menu_tree_output($tree) {
$output = '';
$items = array();
// Pull out just the menu items we are going to render so that we
// get an accurate count for the first/last classes.
foreach ($tree as $data) {
if (!$data['link']['hidden']) {
$items[] = $data;
}
}
to
function _site_map_menu_tree_output($tree) {
$output = '';
$items = array();
// Pull out just the menu items we are going to render so that we
// get an accurate count for the first/last classes.
foreach ($tree as $data) {
// if (!$data['link']['hidden']) {
$items[] = $data;
// }
}
Perhaps is usually, wish can help you.