0
Welcome Guest! Login
0 items Join Now

Bug in Gantry Menu widget

    • kvb's Avatar
    • kvb
    • Newbie
    • Posts: 10
    • Thanks: 0

    Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • Hi,

      I'm in the need of the ability to hide certain menu items based on user role. I found a few plugins that can accomplish this... but they don't work with the Gantry Menu widget :cry:

      The plugin I'm leaning toward to accomplish this is Menu Item Visibility Control . It works with Wordpress core menus, custom menus and other third party menu plugins... just not the only one I need it for... the Gantry menu :cry:

      When I say it doesn't work, I mean it only half works. It'll hide a menu item, it just refuses to then show it when the proper condition is met (such as, a user being logged in, for example). It's not a problem with me entering in improper conditional tags... as when I do that on purpose it throws errors.

      Anything I should know about the Gantry Menu that might cause this to not work (does the Gantry menu just work that much differently from all other nav menus in wordpress?), or do I just wait and hope a fix for whatever bug is causing this makes its way into a future version of the Gantry framework?

      Thanks!
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • Hi,
      what condition are you entering for that menu item?
    • Please don't PM unless requested ;)
      Consider using the custom stylesheet for all your CSS customizations: gantry-framework.org/documentation/wordp...custom_stylesheet.md .
      Please provide the URL to the issue.
      And please mark the thread as solved if the issue is resolved.
    • kvb's Avatar
    • kvb
    • Newbie
    • Posts: 10
    • Thanks: 0

    Re: Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • is_user_logged_in()
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • Hi,
      this condition makes the menu item only appear to users who have already logged to the site (note that when you set a condition for a menu item, that menu item only appears when that condition returns "true"). So does the menu appear to logged in users?
    • Please don't PM unless requested ;)
      Consider using the custom stylesheet for all your CSS customizations: gantry-framework.org/documentation/wordp...custom_stylesheet.md .
      Please provide the URL to the issue.
      And please mark the thread as solved if the issue is resolved.
    • kvb's Avatar
    • kvb
    • Newbie
    • Posts: 10
    • Thanks: 0

    Re: Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • No, it does not appear to logged in users, or logged out users. It just vanishes completely. It works perfectly for the custom menu I have at the bottom of the page, just not the Gantry menu. I've tried various other tags, such as combinations of current_user_can(). The result is the same, the menu item vanishes completely whether the condition returns true or not.

      btw, thanks for the lightning quick support on this. Really top notch!

      Thanks!
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • Hi,
      I can see the issue; I think the problem is that Gantry is caching the menu output somewhere but I'm not sure. I'll see if I can find a solution to make them compatible and update the plugin if possible.
    • Please don't PM unless requested ;)
      Consider using the custom stylesheet for all your CSS customizations: gantry-framework.org/documentation/wordp...custom_stylesheet.md .
      Please provide the URL to the issue.
      And please mark the thread as solved if the issue is resolved.
    • kvb's Avatar
    • kvb
    • Newbie
    • Posts: 10
    • Thanks: 0

    Re: Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • Thanks Shazdeh :mrgreen:

      I have a workaround in mind that will do for the interim.

      Thanks again for your help :mrgreen:
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • Hi,
      made a patch. :cheesy: Extract the attached file in your theme's root directory and then add this bit to your functions.php file:
       
      function load_gantry_menu_wordpress_provider() {
          include trailingslashit( get_template_directory() ) . 'html/gantrymenu/lib/providers/GantryMenuProviderWordpress.php';
      }
      add_action( 'init', 'load_gantry_menu_wordpress_provider' );
       
      What this does it, overrides the GantryMenuProviderWordpress class and disables the menu cache. It now should work fine.
    • Please don't PM unless requested ;)
      Consider using the custom stylesheet for all your CSS customizations: gantry-framework.org/documentation/wordp...custom_stylesheet.md .
      Please provide the URL to the issue.
      And please mark the thread as solved if the issue is resolved.
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • Hi,
      I updated the plugin which contains the fix and makes the plugin compatible with Gantry. So now you just need to update the plugin and it will work just fine.
    • Please don't PM unless requested ;)
      Consider using the custom stylesheet for all your CSS customizations: gantry-framework.org/documentation/wordp...custom_stylesheet.md .
      Please provide the URL to the issue.
      And please mark the thread as solved if the issue is resolved.
    • kvb's Avatar
    • kvb
    • Newbie
    • Posts: 10
    • Thanks: 0

    Re: Bug in Gantry Menu widget

    Posted 11 years 6 months ago
    • Brilliant! Thanks Shazdeh. I was expecting an update to gantry framework... didn't realize I was getting support from the Menu Item Visibility Control developer :mrgreen:

      Works perfectly!

      Thanks again!

Time to create page: 0.053 seconds