DHTML menu is working fone on the navigation menu.
It is failing on the additional menu for a Catalogue. Menu will expand for on area, but not the other. ie/ Catalogue =>Gifts will expand, but another section will not.

UPDATE: Both are failing to open now.

Comments

cburschka’s picture

Status: Active » Postponed (maintainer needs more info)

Hi, can you please view the source of the page and post the menu markup here? It's the part that starts with <ul class="menu">. It is necessary to determine whether this issue is caused by Javascript or server-side PHP.

Also, please view the page in Firefox or another browser with a Javascript Error Console, and post any error messages triggered by Javascript.

GavinC’s picture

Hi, sorry to be a pain where do i get his from

Hi, can you please view the source of the page and post the menu markup here? It's the part that starts with <ul class="menu">. It is necessary to determine whether this issue is caused by Javascript or server-side PHP.

I am really new at this, sorry.

I have run the Java Error Console, and got no complaints

cburschka’s picture

When you right-click anywhere on the page in your browser, you should see a menu that includes an option like "View Page Source" or something similar depending on what browser you are using. When you click it, you get a window with HTML code. Copy that into a text file, then attach the file to this issue (see below).

GavinC’s picture

StatusFileSize
new17.78 KB

Thank you for pointing that out.

Ok. Done. I am running Firefox 3. Attached is the source text file.

GavinC’s picture

Status: Postponed (maintainer needs more info) » Active

Could I hassle you busy guys and gals for an update?

Thank you

GavinC’s picture

Priority: Normal » Critical

could i have an update please? As this is stopping the site from going live :(

cburschka’s picture

Title: Issue expanding » Ubercart DHTML conflict - change "ul.menu" selector.
Priority: Critical » Normal

Um, this is not a menu block. This is a block generated by ubercart, using its own markup.

Since the block does not go through the menu processing system, there is no way for DHTML Menu to load the full menu tree below these items, which is necessary to expand the menus dynamically. That means it can't get any DHTML.

The other problem is that this block "pretends" to be a menu block by being styled with class="menu", which confuses DHTML Menu's Javascript. That is the reason you cannot simply visit the page; DHTML Menu "captures" the click as it believes the block to be an actual menu.

<div id="block-uc_catalog-0" class="clear-block block block-uc_catalog">
  <h2><a href="catalog">Catalog</a></h2>

  <div class="content">
    <ul class="menu">
      <li class="collapsed"><a href="catalog/3/furniture">Furniture (2)</a></li>
      <li class="collapsed"><a href="catalog/1/gifts">Gifts (3)</a></li>
    </ul>
  </div>
</div>

The most I can do is ensure that DHTML Menu uses a different class to avoid collisions (although it's a bit irksome). That would allow you to click through that catalog menu statically, without any Javascript. There is no way to get DHTML on your Catalog menu without massive changes to Ubercart.

cburschka’s picture

Title: Ubercart DHTML conflict - change "ul.menu" selector. » Ubercart DHTML conflict - use module-specific selector
Status: Active » Needs review
StatusFileSize
new1.69 KB

Here's a patch. After applying it to the module, you should see the following difference:

- When clicking the links in your "Catalog" block, you should be taken to the page of that item, instead of nothing happening at all.

---

Turns out I can't change ul.menu, because that is added in theme_menu_tree. Overriding this function is possible, but as the last bug has shown, this overriding technique is not yet perfect and should therefore be avoided when possible. However, I can add an extra class to the <li> element, the next best thing.

GavinC’s picture

Thank you for the patch, i have got it running. Is there any type of menu (like DHTML) that can be used against UberCart's Catalog Block?

cburschka’s picture

Thanks for testing the patch. I'll commit it in a moment. :)

I'm afraid no, there are no modules for what you want. All dynamically expanding menu modules I've seen on this site focus specifically on menus (and most specifically on menu blocks, like this one before 6.x-3.x). There is no module yet that specifically overrides uc_catalog's block generation, which it would need to do to work. You could pay someone in the Paid Services forum to write it for you, but I don't know how complex this task is or how expensive it would be.

I have filed a feature request in the Ubercart project, for using the menu API in uc_catalog. If they do this, then it will automatically become compatible with DHTML Menu, i18n Menu and most other menu-related addons.

cburschka’s picture

Status: Needs review » Fixed

Okay, this one is committed to DRUPAL-6--3.

6.x-3.4 will probably be out later today, once I've checked the bug queue for any remaining issues that can be fixed.

Status: Fixed » Closed (fixed)

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

cburschka’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Status: Closed (fixed) » Patch (to be ported)

Even wihout Ubercart, this extra class is a very good policy and should be in the D7 branch.

cburschka’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new2.22 KB

This should take care of all of it. I'll be testing it a bit in a moment.

cburschka’s picture

Added the strict selectors to CSS too, and used leaf dhtml-menu-fake-leaf rather than dhtml-menu fake-leaf leaf to make sure the fake-leaf items aren't matched later on by li.dhtml-menu.leaf.

cburschka’s picture

Argh, code-style.

cburschka’s picture

Status: Needs review » Fixed

This particular change works. It will not fix a separate bug related to menus where DHTML Menu is supposed to be disabled. I have therefore committed this change to HEAD.

Status: Fixed » Closed (fixed)

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