Is there any way to implement the functionality of DHTML Menu in this module? I'm setting up a rather large taxonomy listing, and would like to reduce the number of page loads as much as possible.

For reference, DHTML Menu is available at http://www.drupal.org/project/dhtml_menu/

Thanks!

Comments

nedjo’s picture

Try inistalling Javascript Tools, enable the activemenu module, enable a taxononomy context block that includes nested terms, and you'll get an AJAX-expanding block. This approach could be adapted to other places in taxonomy context. If you develop a clear spec - details of what you'd want to see - I'll look at it, though I don't know if I'll find time to impement it.

StenBH’s picture

I'm also interested in this issue. I would find it most appealing if the menu was accessible in the core menu module instead of as a separate block. This is the approach of the taxonomy_menu module. As a result the taxonomy_menu works with dhtml_menu. Would this design be acceptable from other perspectives?

bardkerbie’s picture

Category: feature » bug

This sort of works. If i install HEAD and JSTools, I can get parent categories to display child categories in a DHTML list. However, I cannot get child nodes to display unless I actively click on the category. I'll try to do a little debugging, but I feel like I'm in over my head.

Here's the error message:

arg has no properties
http://nfldmn.bpsi.net/misc/jquery.js
Line 2

([null])jquery.js (line 2)
e([null], true, 1, function())jquery.js (line 2)
e()jquery.js (line 2)
success(Object status=true)activemenu.js (line 54)
e(undefined)

Thoughts?

nedjo’s picture

Are you using Internet Explorer? If so, it may be this issue:

http://drupal.org/node/140620

bardkerbie’s picture

I'm using Firefox, though it appears to be a cross-platform issue. I'm going to try applying the JSTools patch listed to see if it fixes the issue; I'll let you know what happens.

bardkerbie’s picture

Still no worky. However, I did a little poking about (I love FireBug) and discovered more specific symptoms.

Let's say I have a vocabulary with a few terms. The first term has two sub-terms, and each sub-term has two nodes apiece. This Taxonomy is displayed in a block:

Term 1
- Sub-Term A
- - Node 1
- - Node 2
- Sub-Term B
- - Node 3
- - Node 4
Term 2

When I click on Term 1, the browser POSTs

taxonomy/term/1

the server returns

{ "status": true, "content": "\x3cul class=\"menu\"\x3e\n\x3cli class=\"collapsed\"\x3e\x3ca href=\"/taxonomy/term/1\" title=\"View this section\"... }

and Sub-Term A and Sub-Term B are displayed.

When I click on Sub-Term A, the browser POSTs

taxonomy/term/8

but the server returns

{ "status": true, "content": null }

and all of the related JavaScript errors out.

Thoughts?

nedjo’s picture

Thanks for this valuable debugging info. This does appear to be a bug in taxonomy context. I'll try to track it down when I get a chance. Meantime, help welcome.

bardkerbie’s picture

Version: 5.x-1.x-dev » master

I think the problem might lie in the taxonomy_context_menu_tree() function. My thought is that the first time Activemenu makes a hook_activemenu call for the Taxonomy Context block, everything gets parsed properly. However, on the second call (for sub-terms and children), something is making taxonomy_context_menu_tree() think that it doesn't have a proper context, and therefore return "content: null".

Am I just making conjecture here, or does this make sense? :)

bardkerbie’s picture

Assigned: Unassigned » bardkerbie
bardkerbie’s picture

I found it.

In the taxonomy_context_menu_tree() function,

$terms = $tid ? taxonomy_get_children($tid, $vid) : taxonomy_get_tree($vid, 0, -1, 1);

returns the tree proper when $tid = FALSE, but returns NULL for children when $tid = TRUE.

When we go to assemble the menu, and evaluate if ($terms), it evaluates to FALSE and NULL is returned as the function's output. Hence the error.

My question is this: Why does taxonomy_get_children() puke when run by the activemenu code, but work properly when run the old-fashioned way?

bardkerbie’s picture

Any thoughts? I've tried slogging though this without any luck.

dami’s picture

Sorry to interrupt, but I installed JStools and Taxonomy Context. Enabled a context block, however the block is not ajax-expandable like DHTML menu, it still needs page reload on every click...Did I miss anything? thanks.

felixsmile’s picture

Interesting issue - subscribing

nedjo’s picture

Title: DHTML in Taxonomy Context » Error when dynamically loading menu items in block

I can't reproduce the issue described here. The menus work for me. So I'm not able to troubleshoot.

@dami, have you enabled activemenu module? It's required for this behavior.

felixsmile’s picture

Using taxonomy context and activemenu (both HEAD versions, otherwise, I don't get the js functionality in the taxonomy context block), I get an error for empty categories: an http error 404 occurrred /?q=activemenu/tc

Otherwise, I would also think it would be great to have an option that would integrate the context menu inside the navigation tree (well, it wouldn't really be context sensitive anymore, but still great...). I posted a feature request here: http://drupal.org/node/155938.

Have a nice day,

Felix.

summit’s picture

Very interested in DHTML menu functionality in taxonomy context.
Any progress in this field?
greetings,
Martijn

summit’s picture

Off course the AJAX functionality in the named modules that speeds up the loading time of the categories.
Greetings,
Martijn