Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yes!! So glad this exists! #1

Open
EranSch opened this issue Jan 16, 2015 · 15 comments
Open

Yes!! So glad this exists! #1

EranSch opened this issue Jan 16, 2015 · 15 comments

Comments

@EranSch
Copy link

EranSch commented Jan 16, 2015

Hey @christianwach -- EranSch from the CiviCRM forums here.

I've gotta say that I'm thrilled that this plugin exists. From the first moment I used CiviCRM I've been wanting to implement a few style corrections at the very least. This is beautiful! 😄

I've often pondered further about what could be done to help the Civi menu integrate more appropriately with WordPress. I've been trying to imagine what would be ideal. From a usability standpoint, I hate how the civicrm menu obscures the WP Admin Bar and I'd like to explore some other options. Have you given any thought to alternatives to explore as well? Is it just me?

Three options seem prevalent to me...

  1. Add an option to offset the page content, make room for both Civi and Admin bar to be displayed at the top of the screen...
    image
  2. Append Civi's menu to Admin bar quicklinks...
    image
  3. Implement Civi menu into main navigation view (this would be cool but seems like the most work...)

Any other thoughts on what could work nicely?

@christianwach
Copy link
Owner

@Swingline0 Thanks for the feedback, glad you like my tweaks!

From a usability standpoint, I hate how the civicrm menu obscures the WP Admin Bar and I'd like to explore some other options. Have you given any thought to alternatives to explore as well? Is it just me?

No, it's not just you - I find it both awful UX and verging on rudeness. But then, in mitigation, I have to remind myself that CiviCRM started off as standalone software and perhaps accommodating CMSs has been something of an afterthought. There is also a consistency across CMSs which I suppose is useful.

Your suggestion (1) is probably the most achievable, as you say, though I'd prefer to reverse the order and have the Civi menu below the WordPress one, perhaps even containing it within the #wpbody element. WordPress is, after all, the container and Civi is only one plugin within that container.

The main problem with all of this is the archaic menu system that Civi uses. It is mind-bogglingly dreadful. Have a look at the markup if you dare - it's not even a nested list! My temptation is to kill it completely and rebuild the items in the WordPress menu bar with a "CiviCRM" top-level item - perhaps to the right hand side. Or, as you suggest in (3), rebuild in the left-hand menu - though I've never seen items more than one sub-level deep implemented there.

In my view, the blocker to any effort in this regard is that there is (or has been) a push to use Bootstrap to theme Civi: for example here and here. I would therefore assume that the menu would be part of any such overhaul. Which is why I just did my best to polish what's already there and wait for things to shake out.

@EranSch
Copy link
Author

EranSch commented Jan 19, 2015

Glad to know I don't simply have unwarranted, high standards 😄

I'd agree with you on all fronts here. Stacking the WP menu above the Civi menu makes perfect sense. At that point, I would personally prefer it be visible in all views of the dashboard instead of only when already in the Civi context. I know you've taken specific steps to avoid loading all the heavy Civi resources on all admin pages so perhaps this could be an optional setting?

I'd love to pursue the path of integrating Civi's menu into the native WP navigation bar as well. I haven't come across or found any accounts of 3+ level deep menus in WP though. Needless to say, might be worth a test to see how it affects UX. The greater unknown for me I suppose would be how/where the markup for the menu is generated and how hookable this is. Any direction you might be able to point me in? I haven't checked the output of this method but would invoking CRM_Core_BAO_Navigation::getNavigationList() get me user's customized Civi menu tree?

@christianwach
Copy link
Owner

No, CRM_Core_BAO_Navigation::getNavigationList() wouldn't work I'm afraid. Have a look at the output - it's an array of space-indented "list items". I have no idea what that's useful for.

The best I could find for returning markup is CRM_Core_BAO_Navigation::createNavigation( $contact_id ); which outputs a nested HTML list (minus the outer ul). I guess that could be written into the admin markup directly, but it would be hard to parse and create a WordPress menu from the data.

What we're really after is a nested array, which requires a bit of jiggery-pokery:

$navigation = array();
CRM_Core_BAO_Navigation::buildNavigationTree($navigation, $parent = NULL, true);
print_r( $navigation ); die();

Hey presto, we have our nested array, but we'd still have to parse it for permissions and translations before creating the WordPress menu items.

Hope that helps!

@redactuk
Copy link

Interesting topic. I'm currently toying with approaching this from a different direction for a client and using pro version of this plugin https://wordpress.org/plugins/admin-menu-editor/ that allows complete editing or both side and top WP menus + assigning permisions to them, with the idea that I basically manually recreate all the CiviCRM menu trees in WP using this plugin, then use WP Members and Groups plugins (with your CiviCRM members sync plugin) to ensure menu permissions pretty much match those set in CiviCRM. Then disable default CiviCRM menu, or mayve only leave for SuperAdmin. Assuming any of that makes sense, I'm wondering whether a future plugin could sync a custom menu added to WP with the one in CiviCRM or even preload the clone when installed.

@christianwach
Copy link
Owner

@redactuk Please keep us in the loop on your progress with this. I heard there are plans to revamp Civi's menu, but don't know if any actual work has been done. I suspect a lot of people would be happy to ditch the current menu in favour of a WordPress-native one.

@dvhirst
Copy link

dvhirst commented Nov 23, 2016

Hi, it's been more than a year since anything has been added. I'm curious to see if more activity is likely.

In the plugin I also see an option for "Upgrade CiviCRM" but no text or explanation of the functionality that results from ticking the box. I may give it a try, but would appreciate some description as well. Thanks for your work on this.

DVHirst
Eugene, OR

@christianwach
Copy link
Owner

@dvhirst I don't see any progress being made on upgrading the CiviCRM menu anytime soon, to be honest. If I get a project that requires it, I'll obviously include the code here.

In the plugin I also see an option for "Upgrade CiviCRM" but no text or explanation of the functionality that results from ticking the box.

It's just a convenient link to the CiviCRM upgrade screen. You'll need to have an updated CiviCRM codebase in place for it to do anything.

Cheers, Christian

@christianwach
Copy link
Owner

@dvhirst It just occurred to me that you might be asking about the plugin more generally rather than addressing this issue in particular. If so, the reason there have been no updates is that there has been no need for any. Do please open a new issue if you find anything amiss with the current plugin.

Cheers, Christian

@christianwach
Copy link
Owner

I'd love to pursue the path of integrating Civi's menu into the native WP navigation bar as well.

@Swingline0 The master branch of this repo now has something of a compromise WRT menus: I have included and adapted a "Shortcuts" menu developed by @kcristiano for @tadpolecc into this plugin. It functions as expected on my installs, but I am not 100% sure that the permissions are properly respected. If you'd care to comment - or to test - that'd be great :-)

@colemanw
Copy link

I'd like to point your attention to the ongoing work to overhaul the CiviCRM menu: https://lab.civicrm.org/dev/core/issues/487
The plan is to integrate the KAM extension into CiviCRM core after doing some major work on it (which is now largely complete).
I think we can then remove most of the menu hacks from this extension and/or migrate them into core.

@christianwach
Copy link
Owner

@colemanw Thanks, but KAM also requires overrides in a WordPress context - and this plugin already implements them. See this file for the current set of fixes.

Integrating these overrides into core would be nice, but then we're back to detecting the host CMS and including a file or targeting a WordPress-specific DOM element in each CSS declaration. For now, it seems to me, locating the fixes in this plugin seems like a good compromise.

@colemanw
Copy link

Well, let me put it this way: as a Core maintainer, I want users to have a good experience of unboxing CiviCRM, rather than installing it, finding that some things don't work right, and having to discover this secret plugin to get those things working (or maybe never finding out about this secret and giving up on Civi in frustration).
So I'd like to include the essentials of your fixes in Civi core. The new menubar code has more flexibility built-in, for example each CMS integration point gets to specify what dom element the menubar gets attached to (defaults to 'body' but could be '#wpwrap' for example). And each CMS integration in core already comes with its own stylesheet, so it's not a problem to add to those.

@christianwach
Copy link
Owner

@colemanw You are of course welcome to migrate any code you see fit to core. This plugin will continue (as it does now) to support whatever core decides to implement, though it's worth remembering that an additional advantage of this plugin is that the fixes included in it also apply to all previous releases of core.

@christianwach
Copy link
Owner

having to discover this secret plugin to get those things working

FWIW, this plugin is far from secret - it's available on the WordPress Plugin Directory (giving CiviCRM visibility there) and is installed on more than 20% of CiviCRM/WordPress instances according to CiviCRM's stats.

@colemanw
Copy link

Not trying to put this plugin down in any way, just thinking like an end user, and wanting to make sure the 80% of people who haven't discovered this plugin are still able to have a good experience using CiviCRM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants