Skip to main content
Beacon9.ca
interactive media for the web

Main menu

  • Home
  • Portfolio
  • Labs
  • Contact

Search form

drupal 6 site map block module

This module lets you display a Drupal sytem menu as a sitemap (all links are expanded - up to 3 links deep) in a block. The block that can be dropped into any region of your theme using the standard blocks interface within Drupal.

This module was based on the footermap module (which does a similar job and has some good features) however, we found the code to be a little confusing, there were some bugs and it didn't render the menus as we would have wished. All three things meant it was unusable for us or our clients. We've spent a few days developing our own much tidier, slimmer and (in our opinion) much better version.

Using the module

  1. upload to your Drupal site and install
  2. configure it - /admin/settings/sitemapblock
  3. choose a region for the block - /admin/build/block

The Latest Version

Version 1.4

  • Added language support - now only shows menu items that are in the current language or language independant
  • Restricted use to primary-links, secondary-links and nav
  • Restricted menu recurse to 3 levels
  • Fixed bugs to do with dupe/disabled menu items

Version 1.5

  • Added support for custom menus

Version 1.6

  • Links to URL Alias rather than node path
  • Supports <firstchild> links from Menu Firstchild module

Version 2.0

  • Direct port from drupal 7 version.
File Attachment: 
sitemap_block-6-2.0.zip

Spread The Love

Tweet
  • Add new comment

Comments

Andrei's picture

Thanks a lot for the module!

Permalink Submitted by Andrei (not verified) on Sat, 11/27/2010 - 01:58

Thanks a lot for the module! Just what was needed.

  • reply
jack's picture

Glad you found it useful!

Permalink Submitted by jack on Sat, 11/27/2010 - 02:10

Glad you found it useful!

  • reply
Anonymous's picture

this is exactly what i was

Permalink Submitted by Anonymous (not verified) on Sat, 11/27/2010 - 02:00

this is exactly what i was looking for too! Although I would appreciate having, in addition to classes for first and last list entries, a class for the middle menu entries as well.

  • reply
jack's picture

Hi - I'm working on this

Permalink Submitted by jack on Sat, 11/27/2010 - 02:11

Hi - I'm working on this module right now. The plan is to have a unique class for each item e.g. item1, item2 etc. PLUS - first last and middle. I'm fixing a bug which causes disabled views menu items to show up in the list as well. Expect an update before the end of the week.

  • reply
Matthew's picture

where does this module get

Permalink Submitted by Matthew (not verified) on Sat, 11/27/2010 - 02:00

where does this module get its list of entries from? I deleted and addded some menu entries and now both the deleted and the added entries are part of the site map block module. How can I make it use only the current menu entries?

  • reply
jack's picture

Hi Matthew, Sounds like the

Permalink Submitted by jack on Sat, 11/27/2010 - 02:11

Hi Matthew, Sounds like the bug I mentioned in my previous comment. I am working on a fix for this right now... if you can hang on `til tomorrow I will post an update.

  • reply
Yoh's picture

Hi all,

Permalink Submitted by Yoh (not verified) on Wed, 10/19/2011 - 03:13

Hi all,

With 6.x-1.6 version, i modify the query in sitemap_block.module line 76
Only publish node is now showing.

replace
<code>
$result = db_query("SELECT ml.* FROM {menu_links} as ml, {menu_router} as m WHERE (m.path = ml.router_path OR ml.router_path = '') AND ml.menu_name = '%s' AND ml.depth = %d AND ml.hidden = 0 ORDER BY ml.weight ASC", $activeMenu, $count);
</code>

By
<code>
$result = db_query("SELECT ml.* FROM {menu_links} as ml, {menu_router} as m, {menu_node} as mn, {node} as n WHERE (m.path = ml.router_path OR ml.router_path = '') AND ml.menu_name = '%s' AND ml.depth = %d AND ml.hidden = 0 AND ml.mlid = mn.mlid AND mn.nid = n.nid AND n.status = 1 ORDER BY ml.weight ASC", $activeMenu, $count);
</code>

  • reply
James's picture

I used your module, and it

Permalink Submitted by James (not verified) on Sat, 11/27/2010 - 02:02

I used your module, and it worked perfectly! I sat down thinking I'd have to delve into PHP and smoke a bunch of cigarettes to stay awake. Your module saved me.

  • reply
jack's picture

haha great! I'm glad it was

Permalink Submitted by jack on Sat, 11/27/2010 - 02:12

haha great! I'm glad it was useful!

  • reply
Joao Ramos's picture

Very nice module, but I think

Permalink Submitted by Joao Ramos (not verified) on Sat, 11/27/2010 - 02:03

Very nice module, but I think you are missing one thing.

The links should link to the url_alia's node and not directly to the node path.

Example: domain.com/about and not domain.com/node/10.

  • reply
jack's picture

Hi Joao - good point will

Permalink Submitted by jack on Sat, 11/27/2010 - 02:12

Hi Joao - good point will post an update in a day or two.

  • reply
Dan's picture

This looks like an

Permalink Submitted by Dan (not verified) on Sat, 11/27/2010 - 02:04

This looks like an improvement on the footermap module. Any idea on how to theme this as i would like to display at the bottom of the page using three or four columns?

  • reply
jack's picture

Hi Dan, you should be able to

Permalink Submitted by jack on Sat, 11/27/2010 - 02:13

Hi Dan, you should be able to style each <ul> as a "column"... the css below should get you started...

.block-sitemap_block ul { display:block; float:left; width:*enter the width of your column here in px*; }

that should get each ul floating next to each other... for more info on floats check out this link http://www.w3schools.com/css/pr_class_float.asp

I recently styled it on this site... you can copy some CSS from there if you need. http://ctfmontreal.com/

  • reply
David's picture

Thanks a lot !!! juste what i

Permalink Submitted by David (not verified) on Sat, 11/27/2010 - 02:05

Thanks a lot !!! juste what i wanted.

  • reply
Dan's picture

Feature request. How about

Permalink Submitted by Dan (not verified) on Sat, 11/27/2010 - 02:18

Feature request. How about the ability to display more than one menu in the site map. for example I would like to display a site map to include both the primary and secondary menus. (similar to footermap module)

  • reply
jack's picture

Hi Dan, how should this be

Permalink Submitted by jack on Sat, 11/27/2010 - 02:19

Hi Dan, how should this be rendered? one < ul > after the other?

  • reply
Dan's picture

Yes, that would probably work

Permalink Submitted by Dan (not verified) on Sat, 11/27/2010 - 02:20

Yes, that would probably work. As long as they can be styled so that they look as one. At the moment I have created a separate menu to be used as a site map and have incorporated 'Multiple Node Menu' but I think your module would be a more elegant solution if it had support for multiple menus.

  • reply
jack's picture

Just posted a drupal 7

Permalink Submitted by jack on Sat, 12/11/2010 - 02:46

Just posted a drupal 7 version of this module - http://beacon9.ca/labs/drupal-7-sitemap-block-module

  • reply
sam's picture

Are you guys planning on

Permalink Submitted by sam (not verified) on Thu, 01/27/2011 - 17:20

Are you guys planning on contributing this back on drupal.org? Would be nice so I can get updates and whatnot through drush.

  • reply
jack's picture

Hi Sam - Yes, we will

Permalink Submitted by jack on Fri, 01/28/2011 - 12:53

Hi Sam - Yes, we will eventually contribute this on drupal.org.

  • reply
jack's picture

Version 2.0 is released. Its

Permalink Submitted by jack on Sun, 02/27/2011 - 15:41

Version 2.0 is released. Its a direct port of 7.1.2 version of the module. Much cleaner code and allows us to recurse deeper into menus.

  • reply
T's picture

This worked for me except not

Permalink Submitted by T (not verified) on Wed, 08/31/2011 - 16:20

This worked for me except not all the primary links showed up or were expanded. Any idea why this would happen? Thanks!

  • reply
jack's picture

you have to set how deep the

Permalink Submitted by jack on Wed, 10/19/2011 - 15:46

you have to set how deep the menus should go, check out the module settings.

it's possible to disable menu items.. check none of your menu items are accidentally disabled.

  • reply
Phil's picture

hiya,

Permalink Submitted by Phil (not verified) on Thu, 10/06/2011 - 11:53

hiya,
great module, but i have tio ask a (probably kind of stupid) question. I checked out your implementation on http://ctfmontreal.com/ and it looks like exactly what i'm after. But how did you get drupal to output each 'primary menu' item in its own <ul>? What am i missing here please?

  • reply
jack's picture

Hey, drupal "nests" the <ul>

Permalink Submitted by jack on Thu, 10/13/2011 - 19:59

Hey, drupal "nests" the <ul> elements for you when you add a new menu item as a child to an existing item.

  • reply
Phil's picture

thanks so much for the

Permalink Submitted by Phil (not verified) on Fri, 10/14/2011 - 09:34

thanks so much for the response. I may be doing something wrong here, I'm not super drupal-literate yet. In Drupal 6 my output from ur module has the entire menu in one <ul>, like this:

<ul id='sitemap_block_parent'>
<li class='first'>link1</li>
<li>link2</li>
<ul id='sitemap_block_295'>
<li class='first'>link2a</li>
<li class='last'>link2b</li>
</ul>
<li>link3</li>
<li class='last'>link4</li>
</ul>

I fiddled your code to output the following:

<ul class='first'>link1</ul>
<ul>link2
<li>link2a</li>
<li>link2b</li>
</ul>
<ul>link3</ul>
<ul>link4</ul>

which appears to be what's on ctfmontreal.com. It allows me to sstyle the <ul>'s next to each other now. if theres a better way, PLEASE let me know. I'm not sure this is valid html :(

thanks again
Phil

  • reply
jack's picture

mmm it might be valid... not

Permalink Submitted by jack on Wed, 10/19/2011 - 15:45

mmm it might be valid... not exactly standard practice though... with the right CSS, you should be able to get the menus next to each other like on ctfmontreal.com. check out the css I used on that site/feel free to copy it if you need.

  • reply
Erin's picture

This is a great module...the

Permalink Submitted by Erin (not verified) on Sat, 01/28/2012 - 15:26

This is a great module...the only thing I'm having trouble with is the recursive settings.

I have a menu that is two levels deep. Only two of the first level links are drop downs. Oddly enough, when I set the sitemap module recursive limit to "2", it doesn't show all my menu links. However, when I set the limit to "3" then all of them show.

The settings for my second level links are the same. Is this how the recursive limit setting is supposed to work, or is there a reason why I can't get all of my second level links to show when the recursive limit is set to "2"?

  • reply

Add new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.

More information about text formats

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Email Facebook RSS

From the Labs

  • Drupal Social Popularity Module
    | 26 Nov
  • Drupal 7 Facebook Comments
    | 08 Nov
  • Drupal Mobile Redirect Module
    | 24 May
  • Drupal 7 Private Files Module
    | 30 Apr
  • Drupal 7 Sitemap Block Module
    | 11 Dec

View Labs

From The Portfolio

View Portfolio

Rank us on #rankable

Copyright © 2009-2010 BEACON9 All rights reserved. Admin Login Powered by Drupal