Hello,

sorry for the long subject.

I am writing a download module to manage files uploaded via ftp.
This is my first attempt to write a module for drupal and my biggest problem at the moment is to get the links rendered in the breadcrumb.

When I request the path "admin/content/downloador" the breadcrumb links are "Home › Administer › Content management" - that's fine
When I request the path "admin/content/downloador/add/category" the breadcrumb links are "Home › Administer › Content management › Downloads" - that's fine too.
But when I request the path "admin/content/downloador/edit/category/1" the breadcrumb links are "Home › Administer › Content management",
which I want to be "Home › Administer › Content management › Downloads".

Is the menu hook the only thing that controls the links shown in the breadcrumb menu ?
What am I doing wrong ?

My menu hook looks like this:

/**
 * Implementation of hook_menu().
 */
function downloador_menu() {
  $items['admin/content/downloador'] = array(
    'title' => 'Downloads',
    'description' => 'Manage downloads.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('downloador_overview_categories'),
    'access arguments' => array('administer downloador'),
    'file' => 'downloador.admin.inc',
  );

  $items['admin/content/downloador/list'] = array(
    'title' => 'List',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );

  $items['admin/content/downloador/add/category'] = array(
    'title' => 'Add category',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('downloador_form_category'),
    'access arguments' => array('administer downloador'),
    'type' => MENU_LOCAL_TASK,
    'parent' => 'admin/content/downloador',
    'file' => 'downloador.admin.inc',
  );

  $items['admin/content/downloador/edit/category/%downloador_category'] = array(
    'title' => 'Edit category',
    'page callback' => 'downloador_admin_category_edit',
    'page arguments' => array(5),
    'access arguments' => array('administer downloador'),
    'type' => MENU_CALLBACK,
    'file' => 'downloador.admin.inc',
  );

  return $items;
}

Thank you very much for your help,
Ingo

Comments

scachi’s picture

Looks like I am hit by a bug: http://drupal.org/node/170309.
The patch in comment #32 fixed my problem.