Jump to content

Expandable menu


Recommended Posts

Hello,

 

I am sorry for my bad English. I don't speak English.

 

In the menu I have the items, after click on them, subitems of this item will display. I need a code, which sets, which submenu will be display or not. After page refresh, I think, the URL determines, which menu will be display and which not - is it true?

Please, help me.

 

 

I hope, you understand me.

 

Thank you

Link to comment
Share on other sites

If I've understood the query correctly, in the back office you need to select Modules then Top Horizontal Menu then Configure.

 

You can specify there which categories you want to appear in the menu. Make sure you enter them in the desired order, as there is no easy way to reorder the categories except to remove them and start again.

 

The subcategories that appear below each category will be those you have set as 'Displayed' via Catalog/Categories.

Link to comment
Share on other sites

it is worth to say that top horizontal menu displays subcategories of the category.

if you don't want to display subcategories - you have to add last category in the category tree,

there is no other way

 

of course some modification of the code will do the trick - but in this case it is necessary to know something about php /smarty

Link to comment
Share on other sites

Sorry I don't understand you... But I think, you don't understand me too.

 

I only want the javascript code, which decides, which subcategories will be displayed and which not. I want to display all menu with all categories, but every items is under every other items.

For example: I have menu with items - "colors", "food", "computer". When I click to "colors", the subcategories for "colors" ("white", "brown", "blue"...) will displayed. Now I refresh a page and the subcategories for "colors" is still displayed. So I need the code, which say "the subcategories for 'colors' will be displayed".

Link to comment
Share on other sites

for the first please tell us what horizontal menu you're using

im just wondering which one because you said that you have to "click" on the category (by default, in prestashop default module you don't have to click on it)

Link to comment
Share on other sites

it's a huge modification of the prestashop, so everything depends on the PHP sources. Unfortuately we don't know them, so it will be really hard to help.

 

You said that you want to use javascript - yes it is possbile, but everything depends on the php sources.

Link to comment
Share on other sites

yes, but sometimes it isn't visible (especially friendly url)

 

id of the selected category is a part of URL, you can get category id with this code:

 

{Tools::getValue('id_category')} - in template file

Tools::getValue('id_category) - in the php file

$_GET['id_category'] - in the php file

Link to comment
Share on other sites

  • 4 weeks later...
×
×
  • Create New...