Skip to main content
did more digging and provided more information
Source Link
alec
  • 407
  • 2
  • 11

If I create a page (like a view in Drupal) I can add a link to it in Civi's Navigation Menu. But then you go to that page and the Navigation Menu disappears. The path for that page is /civicrm/something-custom/civicrm/something-custom but apparently starting with civicrm/*civicrm/* doesn't automagically display the menu. How can How can I make the menu appear on custom pages?

A method via code (hook_something would be better than hack_something) would be sufficient, as I makedon't see any options in the UI at civicrm/admin/menu.

The docs list a hook_civicrm_navigationMenu but it sounds like it only alters the menu appearitself, as opposed to allowing me to display it when it's not otherwise displayed.

I did a grep through the codebase for civicrm-menu and sites/all/modules/civicrm/templates/CRM/common/navigation.js.tpl looked the most promosing but wasn't enlightening itself, then I saw that sites/all/modules/civicrm/CRM/Admin/Page/AJAX.php prints that file inside of a public static function getNavigationMenu() and there's a comment for that function @see smarty_function_crmNavigationMenu. But searching the web doesn't yield any results on invoking these functions in custom pagescode.

Surely this has been done before... right? Is there a proper method for doing so?

If I create a page (like a view in Drupal) I can add a link to it in Civi's Navigation Menu. But then you go to that page and the Navigation Menu disappears. The path for that page is /civicrm/something-custom but apparently starting with civicrm/* doesn't automagically display the menu. How can I make the menu appear on custom pages?

If I create a page (like a view in Drupal) I can add a link to it in Civi's Navigation Menu. But then you go to that page and the Navigation Menu disappears. The path for that page is /civicrm/something-custom but apparently starting with civicrm/* doesn't automagically display the menu. How can I make the menu appear on custom pages?

A method via code (hook_something would be better than hack_something) would be sufficient, as I don't see any options in the UI at civicrm/admin/menu.

The docs list a hook_civicrm_navigationMenu but it sounds like it only alters the menu itself, as opposed to allowing me to display it when it's not otherwise displayed.

I did a grep through the codebase for civicrm-menu and sites/all/modules/civicrm/templates/CRM/common/navigation.js.tpl looked the most promosing but wasn't enlightening itself, then I saw that sites/all/modules/civicrm/CRM/Admin/Page/AJAX.php prints that file inside of a public static function getNavigationMenu() and there's a comment for that function @see smarty_function_crmNavigationMenu. But searching the web doesn't yield any results on invoking these functions in custom code.

Surely this has been done before... right? Is there a proper method for doing so?

edited title
Link

how to display civi's navigation menu on custom page (eg Drupal view path)

Source Link
alec
  • 407
  • 2
  • 11

how to display civi's navigation menu on custom page

If I create a page (like a view in Drupal) I can add a link to it in Civi's Navigation Menu. But then you go to that page and the Navigation Menu disappears. The path for that page is /civicrm/something-custom but apparently starting with civicrm/* doesn't automagically display the menu. How can I make the menu appear on custom pages?