0
Welcome Guest! Login
0 items Join Now

Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

  • Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 5 years 4 weeks ago
    • I am working on a website basewd on Gantry 5 Hydrogen. URL: americathebeautiful.me/
      I have recently noticed that the active link in the main menu wasn't being treated as being active, with the Home link being shaded regardless of what page I navigate to.

      I looked at the code and, as I suspected, the "active" class is what should make the target link change styling, as below:
      <li class="active g-menu-item g-menu-item-103 g-menu-item-type-component g-standard">
      The 'active' class remains stuck on the "Home" link regardless of the page/link I am on. Consequently, "Home" remains highlighted and I have no way to indicate the page a user is on through menu styling.

      I have googled and also searched this forum specifically, but the only hints at something similar I found referenced the necessity of turning on cache in the site, which I did without results (and after clearing the cache multiple times).
      The other post similar to mine referenced having to update Gantry, which is not my issue as that post was 2 years old.
      Unfortunately, this is a difficult topic to research as most questions are regarding CSS styling of the "Active" link, which is not my problem (I really wish it was).

      These are some of the steps I have taken:

      So far I have turned on every form of cache I could think of, and cleared every instance as well.
      I looked at the menu order in the DOM (as that was another possible hint I found somewhere) but even when I published the main menu as the first menu in the DOM nothing changed.
      Since the site is an online shop and I use Hikashop, I added regular (non-hikashop) links to the menu to see if maybe that was the cause, but it wasn't.
      I also switched a number of options on and off to see if they rimediated the issue (and cleared cache afterwards) but so far no luck.
      I methodically turned options on and off in the main menu particle and tested after clearing cache.
      I even removed all my custom.css code, even though I knew it had nothing to do with the "active" class, proving that I was willing to believe in magic to solve the issue.

      My current working theory is that something is wrong with the Menu particle, but I couldn't begin to guess why. I have used Hydrogen in other simple builts and never encountered this issue. If anyone could help it would be much appreciated.
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 5 years 4 weeks ago
  • Re: Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 5 years 3 weeks ago
    • Thank you. Info in secure tab
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 5 years 2 weeks ago
  • Re: Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 4 years 11 months ago
    • Hi, sorry for the late response and than you for your reply, as it often happen, the project was postponed and an emergerncy came up. I hadn't had a chance to review your reply. My apologies.

      I think I understand what you mean, but as far as I can tell, the "home" link in the main menu and the other links did use different outlines already. Home used an Outline by the same name, the other links a different Outline.

      To make sure I created an outline for each menu item, but still I am seeing the same issue in the menu (after clearing caches, etc.). Where the .active class is always showing in the "Home" menu.

      Maybe there is an inheritance problem?

      To explain further, the menu is:

      Home | Apparel | House | Red White Blue | Accessories | Jewelry

      There is an outline for "Home" link and then the other links where using a different outline.
      After reading your response,. I created a differrent outline for "Apparel", "House" and "Red WHite Blue". I cleared the cache and I have also changed the inheritance for Red white a blue to see if that was the issue. It made no difference.

      All I did made no difference. Still the .active class only shows in the "Home" menu and not the other menus. I stopped creating new Outlines until I understand what is causing this. If it's inheritance, what am I doing wrong?

      I guess I can always download a different menu and stick it in a position instead of the Gantry Menu, but I hasve a lot of site that use Gantry and I have never seen this happen. Could it be some obscure setting I changed instead of being a Outline issue?

      My sincere apologies for bothering you again.
  • Re: Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 4 years 11 months ago
    • The issue is fixed. See my screenshot for the Menu particle (you had it set to Home previously).

      This image is hidden for guests.
      Please log in or register to see it.
    • Kind regards,
      Reggie

      Learn to code for free.
      www.freecodecamp.org
  • Re: Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 4 years 11 months ago
    • Never mind. It magically started working after a few hours. I am pretty sure it wasn't browser cache, since I have checked the page with obscure browsers I had never used with this site, so it had to be some kind of Joomla cache that took time to refresh. I had cleared the cache in Gantry, Joomla, etc. and cache is actually off on the site for now. Still it kept showing the site before I assigned different outlines to each link in the main menu.

      At this point, I don;t care how it happened, I am just happy the menu is working properly. I'll call it "Magic Cache" and leave it at that.
  • Re: Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 4 years 10 months ago
  • Re: Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 4 years 10 months ago
    • Thank you. I guess it wasn't magic afterall.
  • Re: Hydrogen Gantry 5 Joomla - Main menu "active" class persistent only on Home

    Posted 4 years 10 months ago

Time to create page: 0.045 seconds