Drupal site map module

I am looking for a module that can create a Sitemap in Drupal, but could not find it. I tried the Sitemap , but it can only generate the site page; he cannot create a sitemap block at the end of each page. I also tried the site menu module , but it also cannot create a sitemap block, as shown above.

Maybe it's just that I don’t know how to set it up, but I read every readme file and tried for several days, but I can’t get it working.

Does anyone have any idea?

+6
drupal
source share
9 answers

I had the same problem by trying the module (site map), but without the settings I wrote my own module. It took less time than messing with the site-map module, since all the code is enough to get a site map (adapt your menu):

function sitemap_render_menu ($menu) { $output = "<ul>"; foreach ($menu as $item) { $link = $item["link"]; if ($link["hidden"]) { continue; } $output .= "<li><a href=\"" . check_url(url($link["href"], $link["options"])) . "\">" . $link["title"] . "</a></li>"; if ($item["below"]) { $output .= sitemap_render_menu($item["below"]); } } $output .= "</ul>"; return $output; } function sitemap_content () { $output = "<h1>Sitemap</h1>"; $output .= "<span id=\"sitemap\">"; $output .= sitemap_render_menu(menu_tree_all_data("your-menu")); $output .= "</span>"; return $output; } function sitemap_menu () { $items = array(); $items["sitemap"] = array ( "title" => "Sitemap", "page callback" => "sitemap_content", "access arguments" => array("access content"), "type" => MENU_CALLBACK); return $items; } 
+11
source share

There is a basic comparison of sitemap modules at http://groups.drupal.org/node/15980

I used sitemenu and it worked for my needs, but the real answer depends on how you structure your site with taxonomy, content types, etc.

+5
source share

Something like Auto Menu may work for you here. You can simply add the menu that it creates in the footer on your main page.

+1
source share

With the Site Map module installed, this PHP code prints a site map.

 <?php echo theme('site_map'); ?> 

You can create an empty viewer and specify above for empty text by choosing the PHP code input format.

There may be a better way to create a custom block to display php code, but I don't know that.

+1
source share

My idea here is to use the Views module with a custom block type.

0
source share

I think you can use the menu module . as you can create menu blocks for all the menus you need in the footer. Then you can add them all in the footer or in one block using the minipanels block (from panels ).

0
source share

You can use the Footer_sitemap module, which provides us with a custom block. https://drupal.org/project/footer_sitemap

0
source share

This is a small variation of the best answer that uses the current topic to display the hierarchy.

 function sitemap_render_menu ($menu) { $output = "<ul class='menu'>"; foreach ($menu as $item) { $link = $item["link"]; if ($link["hidden"]) { continue; } $cc=($item["below"]) ? "class='collapsed'" : ''; $output .= "<li $cc><a href=\"" . check_url(url($link["href"], $link["options"])) . "\">" . $link["title"] . "</a>"; if ($item["below"]) { $output .= sitemap_render_menu($item["below"]); } $output .= "</li>"; } $output .= "</ul>"; return $output; } function sitemap_content ($title,$menu) { $output = "<h1>$title</h1>"; $output .= "<span id=\"sitemap\">"; $output .= sitemap_render_menu(menu_tree_all_data($menu)); $output .= "</span>"; return $output; } function sitemap_menu () { $items = array(); $items["sitemap"] = array ( "title" => "Sitemap", "page callback" => "sitemap_content", "access arguments" => array("access content"), "type" => MENU_CALLBACK); return $items; } print sitemap_content("Navigational menu","Navigation"); 
0
source share

A simple solution that does not depend on the content included as a menu item can be achieved by:

Create a new view

Block output

Using fields:

Content title (configured to "Link this field to the original content"

Content Type (set to Exclude from Display)

Format as

Unformatted list with settings - Grouping field No. 1, select Content: Type;

Filter criteria: Content: published (yes) Content type. Configure to select the types of content you want to include;

Sorting Criteria - Customize to Your Preferences

0
source share

All Articles