Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

"Tweaked" accordion menu

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi,

I'll admit it's perhaps not quite the intended way but if possible I'd certainly like the effect.

I have a main menu in the top menu position, one entry got a tag line from the megamenu config and has two sub entries. All three are set to call a single article with the upper menu item and its first submenu item referring to the same. No probs here.

On the pages attached to these menus I published a second menu in the sidebar-2 position, suffix class accordion. The sub menu items from above are set up as Text Separators here and each of them has sub items. Worked fine immediately - apart from some css needed to align image and menu title nicely on the upper level.

Then I played around a bit with other settings for these upper levels instead of Text Separator because I thought it would be nice if they, too, would point to the same articles as their corresponding entries from the main menu but ran into weird looking of these items in the accordion. So I set them back to Text Separators. Instead I changed the menu titles with the help of NoNumber Sourcerer to something like this: {source 0}a href=...menutitle/a{/source}. This works like a charm apart from one thing: During load I can shortly see the menu being expanded but after loading the page the section is collapsed again. It stays open if I expand it through the icon, but that requires a second click I'd like to avoid. I've tried to find how, where and when the open/closed class is set but wasn't successful. Any hints? Thanks!

Susanne
  • Aldawen's Avatar
  • Aldawen
  • LIfetime Developer - Big Bamboo
  • 39 posts
  • Karma: 1
The administrator has disabled public write access.
Hi Susanne,

Do you have link I'm having trouble visualising the problem?

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
If you want to avoid duplicate links - then perhaps also use the alias link type in the system links section of the link type

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,

the link: devhill.hillwalker.de/index.php/de/

It's still in very early development mode and so far I've only set it up in German although it'll be bilingual in the end. But given the ... well, very limited number of menus that shouldn't matter, I suppose ;)
Thanks for looking!

Susanne
  • Aldawen's Avatar
  • Aldawen
  • LIfetime Developer - Big Bamboo
  • 39 posts
  • Karma: 1
The administrator has disabled public write access.
Hi Susanne,

Where should I be looking as I don't see the example?

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,

oh sorry, it's the right menu "Fernwege" which is this link: devhill.hillwalker.de/index.php/de/fernwege

The accordion menu will be visible on the right side, with both entries ("Schottland" and "Wales") collapsed and the map being the one referring to the first. Klicking on either of the menu items in the accordion produces the effect of shortly opening the menu so that the sub items are visible and having it collapsed it again when the page finished loading.

Thanks
Susanne
  • Aldawen's Avatar
  • Aldawen
  • LIfetime Developer - Big Bamboo
  • 39 posts
  • Karma: 1
The administrator has disabled public write access.
Hi Susanne,

I will to ask another team member to check this out as I don't see this when clicked

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
With the issue do you get the same if you try in different browsers and if you clear the browser history/cache and cookies?

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,

yes, I have the effect on both of my notebooks with three different browsers each even after cleaning the cache etc. As said I'm wondering when and where the open/closed class is set. After loading the page the element looks like this in Firebug:
<span class="separator closed icon-chevron-down">
     <img alt="<a href=/index.php/de/fernwege/wales>Wales</a>" src="/images/flags/wales_small.jpg" original="/images/flags/wales_small.jpg">
     <span class="image-title">
          <a href="/index.php/de/fernwege/wales">Wales</a>
     </span>
</span>
.
When clicking on a menu title I can see it change to
open
for the loading time before switching to
closed
. So I assume it must have something to do with the execution order of certain scripts involved in this accordion effect ...?

Thanks,
Susanne
  • Aldawen's Avatar
  • Aldawen
  • LIfetime Developer - Big Bamboo
  • 39 posts
  • Karma: 1
The administrator has disabled public write access.
Hi Susanne,

Sorry I think I misunderstood your question from the start

When clicking the menu item at the top you are wanting the menu to start expanded on the sidebar?

I don't see all menu items expanding on load on my machines at the moment

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,

I'm not so much concerned with the state of the accordion menu on the right when choosing the main menu item from the top menu although it would be nice if the first item "Schottland" of the accordion would be expanded as this is the one belonging to the map then visible in the main area.

But when clicking on "Wales" in this state, the map changes correctly due to the link associated with the text, but the sub items of Wales (well, it's only one right now, but nonetheless) aren't visible then - unless I click directly on the chevron (which is not part of the "a href" on the country name) to open the accordion. And when "Wales" is the "active" menu item and its corresponding map is visible clicking on "Schottland" would again change the map (= the article) correctly but not leave the accordion expanded to show the two sub-items of "Schottland" - unless, again, clicking the chevron. And this is the behaviour I'd like to change: Clicking on either of the countries should not only change the article but expand this menu as well - which is happening, with Firebug I can even see the html of the elements changing, but when the page has finished loading, the menu is collapsed instead of expanded. So obviously the expanding of the accordion is triggered in the beginning but the effect is "overwritten" by something which happens later - whatever this "something" is ...

Thanks
Susanne
  • Aldawen's Avatar
  • Aldawen
  • LIfetime Developer - Big Bamboo
  • 39 posts
  • Karma: 1
The administrator has disabled public write access.
Hi Susanne,
I think this is because your top level items are links. If you change them to menu separators then the accordion will behave as you have it set.

Thanks
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Hi Anthony,

sorry for the late reply, had been away from my computer for the weekend. You're right, as simple menu separators the top level entries behave as intended. That was my starting point. In fact, they still are of type menu separator. As said in my original post I've only made them links with the help of NoNumbers Sourcerer hoping thus to be able to make them a bit more "intelligent". But obviously the rendering order of the page doesn't allow for this as accordion behaviour happens before other stuff during page load and is reversed by that (whatever it is). What a pity, would have been a nice effect, will have to think of something else then, I'm afraid.

Thanks,
Susanne
  • Aldawen's Avatar
  • Aldawen
  • LIfetime Developer - Big Bamboo
  • 39 posts
  • Karma: 1
The administrator has disabled public write access.
Thanks for the update Susanne

Good luck with it

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers