Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

Vertical Accordion Menu - Active List Item
(1 viewing) (1) Guest
User guides, update and bug fixes
  • Page:
  • 1

TOPIC: Vertical Accordion Menu - Active List Item

Vertical Accordion Menu - Active List Item 10 years, 7 months ago #18587

  • boomer
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
If I have the vertical accordion menu on my site, is there a way I can make one of the menu list items active?

This way it can display children on page load.

Any help with this would greatly be appreciated.

Re: Vertical Accordion Menu - Active List Item 10 years, 7 months ago #18618

  • SA Hoang
Hi Daniel

Can you explain your idea in detail?

Re: Vertical Accordion Menu - Active List Item 10 years, 7 months ago #18638

  • boomer
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
So, I want to use an accordian, vertical menu. So pretty much:

Menu Type: Accordian
Style Flyout: Vertical
Sub Menu Activation: Click

Currently, when the page is loaded, the menu loads as originally intended. (see: old.jpg)

With these settings in mind, when the page is loaded, I want one of the sub-menus to already be opened. (see: new.jpg)

There would be no change in functionality of the menu. Just this one menu opened. If A user were to click on a different menu, the current one that is opened would close just as it always does and the new menu would open up.


Let me know if you didn't understand my description. Pretty much, all I want is for one of the menu items to already be opened when the page is loaded under the settings I mentioned above.
Attachments:

Re: Vertical Accordion Menu - Active List Item 10 years, 6 months ago #18670

  • boomer
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Maybe someone can help me add a small jquery snippet to make this work? I'm not too technical with these things.

Re: Vertical Accordion Menu - Active List Item 10 years, 6 months ago #18671

  • boomer
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Okay, so I was able to accomplish what I wanted. I pretty much hardcoded it. This is what I did:

First I copied the /mod_sj_flat_menu/tmpl/default.php to /templates/TEMPLATE_NAME/html/mod_sj_flat_menu/default.php.

Then I edited the copied file at line 47.

I removed
$li = "<li ".$class.">";


and added
if( $menus[$i]->id == ##### ) {
	$li = "<li class=' default-opened fm-opened '>";
}else{
	$li = "<li ".$class.">";
}

Replace ##### with the menu id from joomla you want to load opened. The reason for adding the class, fm-opened, is so that the plugin's css formatting loads as it should. I also added an extra class "default-opened", because we will need it to open the sub menu via css.

Save file.

Lastly, just add this to your css files
.sj-flat-menu li.default-opened .fm-container {
	display: block;
}


Save. That's it!

Now when the page now loads, you will have this menu's subcategories loaded just as the pictures show in my post above.

This doesn't mess with anything else, because once you click on a different menu item, the plugin's jquery kicks in and overrides my css.


Anyways, thanks for the awesome plugin guys!!
Last Edit: 10 years, 6 months ago by boomer.

Re: Vertical Accordion Menu - Active List Item 10 years, 6 months ago #18689

  • SA Hoang
Hello Daniel,

I am sorry. We stopped working two days

Thanks
  • Page:
  • 1
Time to create page: 0.24 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes