Jump to content

block_top_menu / dropdown / superfish issue


Recommended Posts

Issue: Sub-menu in block_top_menu (categories) does not drop down when parent is hovered on.

 

PS Version: 1.6.08

Theme: My own theme [basically this theme is PS 1.6 default-bootstrap with minor HTML/css changes]

 

URL: http://legalsquid.com/

 

Things to note:

  • I made the theme by copying the PrestaShop 1.6 default-bootstrap theme into another folder and then modifying the html and css.
  • I have made absolutely ZERO javascript changes (code mods nor file structure mods).
  • I have not modified the 'block_top_menu' files at all.  The only modifications that I've done relating to navigation is css.
  • I have modified the header to include some custom HTML.  However, this html was placed in existing divs, or I extended divs with new classes.  The hook ( 'hook_top' ) which contains the block_top_menu module was not nested in any of the divs that I added HTML to, or extended classes of.
  • I did however, remove the hook_top hook and place it in it's own div to separate it from the row that contains the header logo.  I thought that might have something to do with css selectors not getting targeting properly, so I placed it back where it was originally, however, that didn't solve the issue either.
  • I just started on this theme yesterday so I have a lot to go and there are a lot of what look like "bugs" throughout the page, I'm aware of them, and making a ton of modifications as I go, my only concern at this moment is the drop down menu on the categories menu (blue menu)

Thanks in advance for taking a look at my issue.  I appreciate anything you can provide that would help me decipher what I possibly could've done to cause this.  The only thing I can think of is that somewhere in my css mods, I hid it, or something, but I can't seem to find the ghost in the matrix, no matter how much I search.  Again, thank you.

Edited by vegaskev (see edit history)
Link to comment
Share on other sites

UH OH!!!!!!!!  A Bug...where do I file bug reports people?

 

Check it out...if you disable the 'quick search' module (block_top_search) from the displayNav, your dropdown menus will not work.  There is definitely a js dependency here that shouldn't exist.

 

You can see I'm not the only one by reading this thread here => THE THREAD

 

Until PrestaShop team can determine the root of the issue and rectify it, I have a temporary fix (probably needs to include a certain .js file that is also being included by the block_top_search module - which is why dropdowns work when block_top_search is hooked).

 

TEMP FIX:

Add a class to the div that is holding your displayNav hook.  I used 'rnav'.

 

You need that additional class to help target that specific instance of the search bar, otherwise the next bit of css code I give you will hide all instances of the search bar on your site (which I doubt you want to do).

 

hook the quick search module (block_top_search) to displayNav and then add the following css to the stylesheet that you are making your site modifications in.

.rnav #search_block_top {
  display: none !important;
}

In short, what you've done here is added the search_block_top module to the hook so it can fire the dependencies that the submenu dropdown requires in the block_top_menu module so that the drop downs work.  Since that also creates an instance of the search block inside your menu (which you probably don't want, otherwise you wouldn't be having these issues, like me), you need to hide that instance of the search block with the css that I included above, which uses display: none; to simply "not display" the element selected.

 

It's DEFINITELY a hack and is horrible practice, but I simply don't have the time to pour through both of the culprit modules to determine what I need to include in the block_top_menu to correct the bug the proper way.

 

Hopefully a PrestaShop core member will chime in on this thread, create a bug ticket and then share the link to the bug ticket, inside this thread so we can track progress of the bugfix in core and update our stuff once a module(s) updates have been released.

 

Thanks in advance.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...