How to add a block menu of tags (or other taxonomy terms) on a Drupal site

Note: If you want to really bend this block to your will, you might need to learn some module building skills. Check out Build a Module.com for clean video tutorials on modifying the output of a page, theming and lots more.


Instructions

Download and install the Taxonomy Menu module.

Download and install the Menu Block module.

Optionally create a new parent menu where all the taxonomy-based menus will reside by going to /admin/build/menu/add. I named mine Taxonomy.

Go to /admin/content/taxonomy and click the edit vocabulary link next to your tag vocabulary

Scroll down to the Taxonomy menu fieldset

Select your new menu for the Menu Location

I use the following options:

Most of the other options are there so that you can customize the paths to the taxonomy terms if you use Views, for example.

Click Save.

Go to the block administration page at /admin/build/block and click the Add menu block tab.

Start working your way down the form. Here's what I used for the Parent item settings:

I changed the custom visibility settings:

Then click the Save block button.

You'll see the menu in the disabled section of the page, and it will look something like this:

Set where you want the block to display, and then you've got your block! Here's what mine looks like:


If you want to really bend this block to your will, you might need to learn some module building skills. Check out Build a Module.com for clean video tutorials on modifying the output of a page, theming and lots more.

Taxonomy menu~ Menu location: <Taxonofny> The menu and parent under which to insert taxonomy menu items. menu -Options Synchronise changes to this vocabulary Every time term is added/deleted/modified, the corresponding menu link will be altered too. Display number of items Display the number of items per taxonomy terms. Will not show up for vocabulary menu items. gj Hide empty terms Hide terms with no items attached to them. Add item for vocabulary Shows the vocabulary name as the top level menu item of the taxonomy menu. Auto expand menu items Automatically show all menu items as expanded. ■nenu UP menu or SAL LMP JL .10 or S'5 Blocks List Add block Add menu block Bl ocks Blocks Custom visibility settings: Users cannot control whether or not they see this block. BE Shorten URLs <none> configure Taxonomy :"<none> Tlconfiaure Taxonomy (levels none? configure delete Taxonomy NLM JRLs ES mint Lire fit IQ NEZ delete i--Hcon figure configure Parent item: Menu: Taxonomy Item: <rootof Taxonomy> The tree of links will only contain children of the selected parent tem. Using <the menu selected by the page> can be customized on the Menu block settings page. Item: of on lk lk. '•le Topics activism (21 apple software f6 book reviews design Drupal (27) drupal administration drupal community (13) drupal events dr modules f8 drupal resources (111 freakv stuff geeky entertainment iphone ipod touch jquery learning f6 life hacks f6 looping fl maps fl minimalism LD (4J C3) C2) -at NAT dr li.
File attachments: 


Comments

Thanks for this post. I added a link back from the Taxonomy Menu project page (http://drupal.org/project/taxonomy_menu)

Very cool, thanks Neil!

Is there any way to put the taxonomy terms of a node you are currently viewing in a block? I know this has something to do with Context but not sure if I can tie that in with this module?

You could use a View and set an argument to pull in the nid of the node. Then, create a block display and use the block admin page or Context to display it on just the node pages.

Cheers!

Worked like a charm, many thanks!

Some note,
this method works only for Item: .
It is because, if you rebuild the taxonomy_menu, the mlid for selected menu_block item is deleted and you will see links of root of menu [vocab name].
So you have to change settings of menu_block each time you rebuild taxonomy_menu.

This method works only if you select option 'root of [vocab name]'
Sorry for mistake above.

hi, how can i have 2 vocab for example 'teachers' and 'lessons' for a content type and when user choose a teacher in 'teachers' vocab,the 'lesson' vocab box below that just show lesson that those teacher teach and other terms in that don't represent for user because it don't confuse whit many terms.i want 2 vocabularei's terms related together.
how can i do that,with taxonomy or another modules.please help to me

If the teacher is a node, you could most likely use an argument to pull in matching taxonomy terms for the lessons into a view. If both are content types, I would suggest using a node reference field instead. If both are vocabularies, you will need to explore views relationships to connect up the term with the node, and then the node with the terms in the other vocabulary.

I hope that helps!

Cheers,
Chris

Thanks! I've been trying to find an easy way to do this. How do you create a menu block like the one you created for archives? Thanks!

Hey Seth, I wrote a blog post to answer your question here: http://chrisshattuck.com/blog/how-create-monthly-archive-block-drupal-bl.... In summary, you can just enable the archive view that comes bundled with Views, and then set the block to display. However, I also outline the more complicated method of creating the view yourself.

Cheers!

Just a note. Nothing of this will work if you have the "taxonomy_term" view enabled in Views. It took me a while to figure it out!

I'm new to Drupal, where is the "views" page?

Hi Hana, you can find it at /admin/build/views. Cheers!

I must be doing something wrong, because it's not working for me. It seems that the menu is made correctly because once I expand my admin tree I can see my vocabulary under the Taxonomy parent menu. I can also see another set underneath that with the same vocabulary. Looks like what I've pasted below. BUT when I try to activate the menu onto my right sidebar (or left, or header, or anything) it just doesn't show up...

Administer

* Content management
* Site building
o Blocks
o Menus
+ Navigation
+ Primary links
+ Secondary links
+ Taxonomy parent
# Years
* 1997 (0)
* 1998 (0)
* 1999 (0)
* 2000 (0)
* 2001 (0)
* 2002 (0)
* 2003 (0)
* 2004 (0)
* 2005 (0)
* 2006 (0)
* 2007 (0)
* 2008 (0)
* 2009 (0)
* 2010 (1)
+ Years
# Years

Thanx for this guide. Is it possible to link the parent-item with a custom link?

current parent-link looks like this: http://www.testside.com/taxonomy/term/1 16 8 9 13 3 10 11 15 7 17 12 14
what i want: http://www.testside.com/ (Homepage)

Thanks so much for the guide. I'm still a noob at this and I'm looking for advice for the best method so that if the user clicks on, for example, the menu block link for the taxonomy term "Fruit" and there's just 1 entry that it skips straight to that entry's node and bypasses the list.

What are the benefits/disadvantages of this taxonomy menu set up you have outlined compared to using views blocks for menus that have the "link direct to taxonomy term page" checked?

Hi Mark,

could you detail your solution?

Regards,
eduardo

Great tutorial - thanks for sharing.

Hi - I've installed your module for a site (first try with Drupal after years of WP development) I'm building.

I have a menu up and running for the blog categories. the block it's in is set to only display on the blog pages.

The problem I have is the menu disappears when you click to view a blog post. I think this is due to the blog category in the url disappearing when you view an individual post.

Can you suggest a method to get round this? I don't want to add each post into the 'view this block on these pages' window if I can help it.

Thanks,

S

@Steven Use the context module to place blocks. It will allow to to have the block visible on all blog nodes.

http://drupal.org/project/context

Thanks indytechcook.

I've set the condition to 'Node type > blog entry'

and reactions to 'block' with a block I've made of the blog categories in the 'first sidebar'.

When I click save and view a blog post, I don't see the menu.

Is there something else I need to do?

Thanks Dude

this is not clear... the instructions should be more in steps 1, 2, 3,

Is there any way to get this block to sort the terms by number of occurrences? Thanks in advance.

It's rare to find a tutorial this easy to follow ... and it actually worked just like that! :) Thanks Chris!

very thanks for this great tutorial.

Have the same question myself regarding sorting.

Had no issue following instructions, works well, but yeah just wish to sort it by occurrences. Also is it possible to limit the number of taxonomy words it displays? (ie. top 10 values)

Would love to know how to sort it too

Great tutorial. Thanks for posting it, was something I was looking at implementing on my site, but not sure I'm 100% happy with it as I think it'd be better with trimming it down to maybe top 10 or 20 topics on site, otherwise it feels a bit out of control.

Hey, Thank you for the post. It's really helpful.

I have followed the tutorial and i am able to view the block in my homepage. The problem is , it's not in a right format. For example it displays as "title1, title2, title 3 etc".

I would like it to be displayed as
"Title 1
Title 2
Title 3".

Please let me know , if I am missing something.

Is there a way to change the titles of the listing-"page" shown when clicking a parent term in the menu?
I mean: now i get titles like
a+b+c+d...
Is it possible to show us only "a" or even nothing?

Hi, I followed your tutor, but can't see the menu block in the leftside region, only those menu with menu items shows up, menu with taxonomy items doesn't show up, why?

great post , thank you big thanks

Hello,
perhaps you can help me out.
I followed your tutorial here. Nice work!

I have tried to implement a basic hierarchy into the Groups of Open Atrium. So I created a taxanomy, created some terms and applied some groups to these terms.
When I go into the taxonomy menu, I see all ther terms (good). When I click on one term I see all the groups which I have given this taxonomy term (still good...) but when I click on one group in this view, then it wants to take me to xxx/node26 which is not accessible (it throws a access denied). I think that the group has to be accessed not by node-id but with the group name.

I think I missconfigured something somewhere.
Can you give me a hint about this?

Chris,

I'm able to get the taxonomy menu to work. How can I format the destination after clicking the link?

Thanks,

Mike

Where are the "Options" like "Synchronise changes to this vocabulary?"

I using Drupal 7, maybe things have changed?

Same question here. Is it still available in d7?

Same here, no options to choose from and all my menu items are by default expanded (not very pretty). dled 'taxnomy_menu_trails' but that didn't seem to help much either?

Hey,
Is this your method works in drupal 7 ? How then find the following statement:"Go to /admin/content/taxonomy and click the edit vocabulary link next to your tag vocabulary

Scroll down to the Taxonomy menu fieldset"

thank you in advance

Would be great if you could post the steps for Drupal 7.
Thanks!

Hi,

I followed the instructions,but I have the problem.
On the second step,where I click the "Add menu block",
when I try to set Menu:Taxonomy,there is no "Taxonomy to select.
I only have the options "Primary links,Secondary links and Navigation".
I tried it twice but the problem exists.Why there is no "Taxonomy"
.(It is meant that I have done the first step before).

Anyone help me?
Thank for your time

Great tutorial! Very easy to follow.

Is there a way to change the taxonomy term URL from
.../taxonomy/term/52

to something from the vocabulary like
.../taxonomy/people/52
or
.../people/52?

I want to limit the places where the menu shows up by setting the block context, and it would be nice to use wildcards instead of listing every term.

Hi!

Great tutorial.

We do it, and works fine, but we have a problem.

If you are logged in you can see the block, but the anonuymous visitors can't see it.

Anyone knows why?

Thank you and congratulations for the tutorial!!

Ferran

@Ferran Did you check the permissions ?

@Sokratis try flushing your menu cache

Hi,Thnks for such a valuable gift.I want the menu as a dropdown menu,e.g when clicked only then it will be expanded.How can I assure that?

There's still one major issue which affects the overall use of Taxonomy Menu (and especially the subject of your tutorial): http://drupal.org/node/317753

This module is exactly what I need!

EXCEPT! ---

I can't get the block to display. I followed the directions almost exactly, but the display is a little different now. My "Photography Taxonomy Menu (expanded levels 1+)" has all the evidence of being available, but when I place it in the Right Sidebar, it doesn't appear. I even checked "Expand All Children". Any thoughts?

Using Menu Block 7.x-2.x-dev && Taxonomy Menu 7.x-1.x-dev.

Hi, I'm trying to get this to work with the custom views on D7.

In the documentation readme.txt it says I needc Taxonomy menu custom path, and taxonomy menu hierarchy modules. But where do I find these? They don't get installed with the taxonomy module, and I can't find them anywhere in the modules directory.

Thanks

The Taxonomy Menu Custom Path module is downloaded with the Taxonomy Menu module. Look in the sites/all/modules/taxonomy_menu folder. You'll find it there. If you cannot find it, try deleting the existing taxonomy_menu folder, download a fresh Taxonomy Menu module from Drupal.org, and uploading the fresh module to the sites/all/modules folder. Then install per normal steps. I hope this helps.

Peace,
- Frederico Garza

I'm trying to build my Drupal credentials but I'm running into roadblocks with the taxonomy. I'm having the exact same problem as Ben, I can't get the menu to display on my sidebar. I've been stuck on this for 2 days now, so any help or ideas would be great.

This doesn't work with i18n :(

not sure, but how does it works on drupal7?

Is there a way to keep certain terms from not appearing in the list while others do appear?

having same issues as Ben and Quinn. trying everything i can think of. menu does not show taxo links? can't get menu block to appear.

has anyone found the problem here?

Thanks, it is great to auto link from taxonomy

Is it possible to link the parent-item within or without custom link at D7?
menu sample
taxonomy/term/1 list all of 1+2+3
taxonomy/term/1+2+3 same as above

taxonomy_menu-7.x-1.2 does not work both above, as I know D7 does not support this pattern.

Hope taxonomy_menu can fix this problem, or any other solution?

Hi Chris
How are you?
At first i should say i'm interested about your very useful blog and it's content. I LIKE IT!
I have a question about implementation of specific scenario in Drupal.
I want a bit more functionality.
I want each block has own title image & this block title link to vocabulary page.
This is all!
Have you any solution for it?

thanks

Which version of drupal will this work on?

Hi Chris.

I don't find the options you show in the capture. I mean the options including "Synchronises change to this vocabulary ".

Maybe I'm using D7 and tutorial is for D6? Where are these options in D7?

Thanks

I'm trying to implement taxonomy menu module but it's now working. I read one of comment that it is not working with i18n.

Is it really these module not working with i18n(multilingual) module? I want to set up taxonomy menu module with i18n module. Could you pls. suggest steps?

Thanks in advance.

Hemant Pancholi

Doesn't appear to work with D7. Anyone have any luck with D7? Also as someone mentioned above modules, Taxonomy Menu Custom Path and Taxonomy Menu Hierarchy, are not present at all.

I deleted and downloaded again, first using Drush then doing a manual download. But those modules are no where to be seen. I downloaded the latest stable version, I guess I'll try the dev...

For everyone using D7, use the dev version of taxonomy menu to have the Options fieldset appear properly. I just verified this.

Thanks

I can confirm this. After upgrading from v7.x-1.2 (2011-Jul-19) to v7.x-1.x-dev (2012-Apr-27) I had to:

* Run the update script (update.php)
* Clear the cache to be safe (admin/config/development/performance)
* And rebuild the menu (last option on the Edit page of your vocabulary, 'Select to rebuild the menu on submit.')

When using this method with Taxonomy_Term Views enabled, every time you create a new taxonomy category, you must go into Taxonomy Views and update Argument: Term ID (with depth). There are checkboxes that must be enabled for each taxonomy vocabulary.

Took me several hours to figure out why my original taxonomy lists were showing up, and the new ones wouldn't. I hope this helps someone else.

Thanks for the great post!

Hello, and thank you for the advice in your post.

I've got one question : how could you show in the taxonomy menu block, not only the terms but, as parent items, the vocabularies, and then the termes of these vocabularies being children items ?

For instance, let's say we want to display this (vocabs + terms):

Pastas (vocab 1)
- Spaghetti
- Penne
- Farfalle
Fruits (vocab 2)
- Orange
- Apple
--- Royal Gala
--- Golden
- Kiwi
--- From Carribean
--- From Central America

Instead of, presently, this (only terms):

Spaghetti
Penne
Farfalle
Orange
Apple
- Royal Gala
- Golden
Kiwi
- From Carribean
- From Central America

?

Thanx for help

I've got the answer, I simply didn't have this option but it's fine, now that I've installed the dev version of Taxonomy Menu.

See post from DeVurge a few lines above.

To add some information, there is appearantly no update.php file in the package for the dev version. Because Drupal admin found no update for this module, I needed to uninstall the current one and then install the dev one. But doing so I lost the existing taxonomy menus.

I want to be able to limit taxonomy menu to only link to specific vocabs.
Say I have a "States" vocab with various terms, ie New York, Hawaii, Texas, etc. I then have a "Services" vocab with various business types terms such as Real estate, Accounting, Car Sales, Doctors etc. Then another vocab called "Events" which has terms like Conferences, meetings, Training etc. I then create some content and link the vocab terms to them. So I might have a article linked to the New York and real estate terms, I then have another article linked to New York and Conference terms.

When I create a menu for a Services page using Taxonomy Menu and the "States" vocab it shows any content linked with the "States" vocab. I want a "States" and "Services" menu and then a "States" and "Events" menu.

Can taxonomy menu do this?

Tia

Jeremy