Sign Up for OSTraining

Welcome, Guest
Username: Password: Remember me

TOPIC: Multi level Accordian functionality

Multi level Accordian functionality 1 year 2 weeks ago #45029

Hi,

I'm trying to implement multi-level accordian for menu block in drupal6.
The hierarchy goes like...

Super Parent 1
|_ _Parent 1
| |_ _ Child 1
| |_ _ Child 2
|
|_ _ Parent 2
|_ _ Child 1
|_ _ Child 2

Super Parent 2
|_ _Parent 1
| |_ _ Child 1
| |_ _ Child 2
|
|_ _ Parent 2
|_ _ Child 1
|_ _ Child 2


So the accordian functionality should work as when you hover on that particular object. I'hv already tried Views Accordian module, unfortunately it doesnt support multilevel accordian. Please can you help me achieve this functionality.
Please become a member of OSTraining to reply to this post.

Multi level Accordian functionality 1 year 2 weeks ago #45084

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3949
  • Thank you received: 134
  • Karma: 9
Hi Ravikanth,

If you are interested in creating a multi level accordion menu, you can do this by using jQuery code.

Here is an example I have created (with the inspiration of other code of course) which uses the jQuery 1.7.1 code, but you can use more recent versions and it will still work.

jsfiddle.net/MS6Zj/10/embedded/result/
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

Multi level Accordian functionality 1 year 2 weeks ago #45086

Tessa,
Thankyou so much for this code...my question is does it works for drupal6 ?
Do i need to build a module or can I implement this jquery on the existing views template files?
Please become a member of OSTraining to reply to this post.

Multi level Accordian functionality 1 year 2 weeks ago #45096

  • edandrea
  • edandrea's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 3106
  • Thank you received: 7
  • Karma: 0
Hi Ravikanth,

There are several modules that create drop-down menus. Do you want an accordian menu like this
jqueryui.com/demos/accordion/

or a dropdown menu like these.
drupal.org/node/990154

You shouldn't need to write a module for a dropdown, but nested accordian menus are something different.

Let us know if these links help you.

Cheers,
Ed
Please become a member of OSTraining to reply to this post.

Multi level Accordian functionality 1 year 2 weeks ago #45114

Edandrea,

Thanks for your post, I have mentioned in my first post about the menu hierarchy, that I need some nested accordian functionality. Tessa implemented some jquery acsordian, but my question is can I implement that jquery functionality in my views template file.

Please become a member of OSTraining to reply to this post.

Multi level Accordian functionality 1 year 2 weeks ago #45138

  • steve
  • steve's Avatar
  • OFFLINE
  • Administrator
  • Posts: 3053
  • Thank you received: 163
  • Karma: 26
Hi Ravikanth

Some points:

1) Generally our advice will be to try and do this by modules rather than code, if possible. That's partly practical ( our support doesn't really cover code www.ostraining.com/support-faq/ ) but also because we believe that the whole point of Drupal is to use modules rather than custom code.

2) Wanting to add an accordion to block created in Views, does limit your choice somewhat. Views Accordion might be your best / only choice. However, what is it you're showing in the block? If its Taxonomy items, there are quite a few more modules for that.

3) Normally each extra level in any menu accordion requires the writing of some custom code. So if Views Accordion has 2 levels and you want 3, you'll need more code. If you want 4, that requires even more code.


Ask. We'll help. It's as simple as that.

Follow us on Twitter - twitter.com/ostraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

Sign Up for OSTraining

Powered by Kunena Forum

Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.

Copyright 2013 Open Source Training, LLC. All rights reserved.