Not sure if this is a sitemap or a menuviews issue, but the sitemap displays the complete menu views, not just the links.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markhalliwell’s picture

Status: Active » Postponed (maintainer needs more info)

I believe this should be fixed in the 2.x branch. Please let me know if it fixes it. Thanks!

FranCarstens’s picture

Not sure which sitemap is referred to, but I'm not getting any display in sitemap-xml. Is there a way to do this?

rwinikates’s picture

Version: 7.x-1.3 » 7.x-2.1
Status: Postponed (maintainer needs more info) » Active

Likewise, running menu views 2.1 and xml sitemap 2.0-rc2 and my xml sitemap generates this:

<url>
<loc>http://mysite.com/%3Cview%3E</loc>
<priority>0.9</priority>
</url>
BBC’s picture

Same is true for the Site Map Module, which might be what the original commenter was referring to.

Example output is:

<ul class="site-map-menu">
<li class="first last leaf">
<a title="" href="/%3Cview%3E">Menu View Item</a>
</li>
</ul>
GaëlG’s picture

Issue summary: View changes

For the sitemap module, you can try this:

function MY_THEME_site_map_menu_link($variables) {
  $element = $variables['element'];
  $sub_menu = '';

  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }

  if (function_exists('_menu_views_get_item')) {
    $item = _menu_views_get_item($element);
    if ($item['type'] == 'view') {
      return menu_views_menu_link($variables);
    }
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}
ron_s’s picture

Version: 7.x-2.1 » 7.x-2.x-dev
Status: Active » Needs review
FileSize
1.38 KB

Regarding XML Sitemap, there is no option available with Menu Views to configure settings per menu item. This leads to incorrect results in sitemap.xml as @rwinikates mentioned in #2. We were seeing entries in our sitemap of "http://domain.com/%3Cview%3E".

To fix this, we took an approach similar to the Special Menu Items (https://www.drupal.org/project/special_menu_items) module. Special Menu Items stores non-standard menu links, such as <hr> separators. If XML Sitemap is marked as "included" for the menu item, it leads to sitemap entries of "http://domain.com/%3Chr%3E". The way to fix this is exclude XML Sitemap settings for each Special Menu Item. Excluding the separators removes the improper sitemap entries.

This option is not possible with Menu Views since the module clears out all supporting fieldsets except Menu Item Settings. To allow us to control XML Sitemap values on menu items with Views, we've created a patch that sets the XML Sitemap's #weight appropriately, and skips $child entries of 'xmlsitemap' when they exist.

Not sure if this is the best way to accomplish this, but it certainly works.

  • markcarver committed c7bb10c on authored by ron_s
    Issue #1478788 by ron_s: Site map displays complete menu views
    
markhalliwell’s picture

Category: Support request » Feature request
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.