I'm creating several views that are to be used as reports. Since they all have a common topic, I'm grouping the views under a sub-path of admin/reports (e.g. admin/reports/data/needs_correction and admin/reports/data/status).

With most admin sections in Drupal, there's usually a landing page that lists all of the sub-content for the section. So, to provide that, I've implemented hook_menu() in the feature that contains the exported report views, as follows:

 * Implements hook_menu().
function MY_menu() {
  $items = array();

  $items['admin/reports/data'] = array(
    'title'             => 'Data reports',
    'description'       => 'Various reports on the status of data in the system.',
    'position'          => 'left',
    'page callback'     => 'system_admin_menu_block_page',
    'access arguments'  => array('access administration pages'),
    'file'              => 'system.admin.inc',
    'file path'         => drupal_get_path('module', 'system'),

  return $items;

The only problem is that, after a cache clear, when I navigate to admin/reports/data, all I get is the message "You do not have any administrative items."


In addition to the report views needing to have "Page" displays with URLs nested under admin/reports/data, I also had to make sure the following settings were enabled under "Page: Menu item entry" settings within the Views:

  • Type: Normal menu entry
  • Menu: Management

Without both of these settings, the menu links will not show up under the new custom reports page.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.