Upcoming Events

NYC CiviCRM Meetup - September 7th
September 7th, 2010
This next NYC meetup will feature a case study or 2, a look at what's new in (more...)

Configuring, Customizing and Extending CiviCRM - New York
September 16th, 2010
This comprehensive two-day hands on training course is targeted at (more...)

CiviCRM User and Administrator Training - New York
September 16th, 2010
A comprehensive two day hands on training course covering the configuration, (more...)

CiviCRM Code and Test Sprint - New York
September 18th, 2010
This code and test sprint is targeted at experienced developers who want to (more...)

CiviCRM Toronto Meetup
September 21st, 2010
Come meet others from the Toronto Area who are interested in, using or (more...)

CiviCRM Philly Meetup – September 2010
September 23rd, 2010
Come meet others from the Philadelphia Area who are interested in, using or (more...)

CiviCRM Seminar - Dublin
September 28th, 2010
NfP Services are hosting a free seminar at The IBOA, Stephen St Upper, Dublin 8 (more...)

London developer and implementer training
September 30th, 2010
This comprehensive two-day hands on training course is targeted at implementers, (more...)

London user and administrator training
September 30th, 2010
A comprehensive two day hands on training course covering the configuration, (more...)

Berlin user and administrator training
October 6th, 2010
A comprehensive one day hands on training course covering the configuration, (more...)

Berlin developer and implementer training
October 7th, 2010
This comprehensive one-day hands on training course is targeted at implementers, (more...)

Benelux meetup in Brussels: Connect, communicate and activate your supporters and constituents
October 11th, 2010
Come meet others who are interested in, using or developing for CiviCRM. For (more...)

CiviCRM Toronto Meetup
October 19th, 2010
Come meet others from the Toronto Area who are interested in, using or (more...)

CiviCRM Toronto Meetup
November 16th, 2010
Come meet others from the Toronto Area who are interested in, using or (more...)

CiviCRM Components

Tools for engaging your supporters...

CiviContribute


CiviEvent


CiviMail


CiviMember


CiviReport


CiviCRM v2.1 Menu Redesign

Not Just a Contact Database

These optional components give you more power to connect and engage your supporters.

  • civiEVENT

  • Online event registration and participant tracking.

  • civiMEMBER

  • Online signup and membership management.

  • civiMAIL

  • Personalized email blasts and newsletters.

  • civiREPORT

  • Report generation and template management.

April 18, 2008 - 14:12 — lobo

Drupal 6 introduced a new menu system. CiviCRM had modeled its menu system after drupal 4.x which meant we needed to upgrade the menu code significantly to upgrade CiviCRM to Drupal 6. We took the opportunity to learn and understand more from drupal's new system and also simplify the interface between CiviCRM and Drupal with regard to the menu hook.

The CiviCRM menu system has been based on the Drupal menu system, so all credit for the below goes to chx and the Drupal folks (all blame should be assigned to us). We have simplified and extended it a bit to meet our needs. Similar to Drupal menu system, the CiviCRM menu data now resides in the database. civicrm_menu stores all the information for a menu item.

CREATE TABLE civicrm_menu (
     id int unsigned NOT NULL AUTO_INCREMENT  ,
     domain_id int unsigned NOT NULL   ,
     path varchar(255)    COMMENT 'Path Name',
     path_arguments text    COMMENT 'Arguments to pass to the url',
     title varchar(255)    COMMENT 'Menu Title',
     access_callback varchar(255)    COMMENT 'Function to call to check access permissions',
     access_arguments text    COMMENT 'Arguments to pass to access callback',
     page_callback varchar(255)    COMMENT 'function to call for this url',
     page_arguments text    COMMENT 'Arguments to pass to page callback',
     breadcrumb text    COMMENT 'Breadcrumb for the path.',
     component_id int unsigned    COMMENT 'Component that this menu item belongs to',
     is_active tinyint    COMMENT 'Is this menu item active?',
     is_public tinyint    COMMENT 'Is this menu accessible to the public?',
     is_exposed tinyint    COMMENT 'Is this menu exposed to the navigation system?',
     weight int NOT NULL  DEFAULT 1 COMMENT 'Ordering of the menu items in various blocks.',
     type int NOT NULL  DEFAULT 1 COMMENT 'Drupal menu type.',
     page_type int NOT NULL  DEFAULT 1 COMMENT 'CiviCRM menu type.'
)

We now interface with Drupal with only one menu item, i.e. the top level 'civicrm' item which does a callback into the civicrm code. This menu item is not permissioned, i.e. everyone has access. Permissioning is now handled within the CiviCRM menu system, which should make it a bit easier to transition to our ACL based permissioning system (currently being tested in the standalone release).

Instead of storing the menu items as php arrays, we store it in a xml format. The menu xml files are in the civicrm templates directory. The xml files are read only during the menu rebuild process to populate the menu table. This process is run only at install / upgrade time. Hence there is no performance penalty for using xml based storage. This does enable folks to edit and change entries at the xml level if needed. We are also planning to implement "menu hooks" for use by other civicrm modules. This is a significant improvement over the current approach, where folks needed to write their own "invoke file" and hack some civicrm code to integrate other components.

We do a fair amount of computation during menu rebuild. To make things more efficient in the rendering process, we ensure that all menu items have all the database fields. Thus we propagate values for access_callback et al down the path tree if not already specified. We also compute the values for the navigation and admin blocks for the system and also the breadcrumb for each path. This saves on processing and db lookups when we render a civicrm page.

The above changes let us get rid of all the Invoke files in the system. It also makes things more consistent and easier to extend. I suspect there is also some performance impact for the better. Most of the changes described above are implemented and functional in trunk

Comments

Is this going to be for the

Is this going to be for the 2.1 version?

Barry Jenkins - Petition Inc. CEO

Yes, its already part of 2.1 ..

so far, we've been pretty pleased with the results. lets us make a fair amount of changes at the xml level that automatically get managed at the code level

Using CiviCRM for donor management? Vote for CiviCRM at at NTEN Survey: http://www.surveymonkey.com/s.aspx?sm=IyoKNSWjxs882CDPlpAlwA_3d_3d

Can we expect civicrm menu

Can we expect civicrm menu hooks or api functions for easily & dynamically injecting options into menus?

civicrm menu hooks will be implemented for the 2.1 release ..

we dont have it right now in the code base, but i do plan on adding it when we revisit and do some more cleanup / development on the menu system in the next few weeks

Great !

Is this going to be for the 2.1 version ?

As for the menu, are you going to take that opportunity to reorganise it (contentwise) as well ? I've read various comments on the forum about people not finding it intuitive (myself including) and some usability gurues offering to help, has it reached something ?

X+

P.S. Certainly not the right place to ask, but is it possible to use it to create a shortcut block with your own links (eg using profiles) ?

Can you post specific links to the

forums post and the offers to help by usability folks

I'll have to take a look and see how the shortcuts block is created, but potentially it can be moved to the menuing system also

thanx

lobo