1

I would like to add a link to my module in the Structure admin page.

I already use a hook_menu for turn in my module accessible but how can I add a link in the "structure" admin section ?

function tamtamimporter_modules_menu() { $items['admin/config/tamtamimporter'] = array( 'title' => 'Gestion du Tamtam importer', 'description' => 'Gestion de l\'importation des flux par le biais du module Tamtam importer', 'page callback' => 'tamtamimporter_modules_page', 'page arguments' => array('tamtamimporter_modules_page'), 'access arguments' => array('administer site configuration'), 'file' => 'tamtamimporter_modules.admin_list.inc', 'type' => MENU_NORMAL_ITEM, ); }

Thank you very much for you help.

1

Is it currently appearing under config? I think all you need to do is change the path to being 'admin/structure/mylinkgoeshere' and a link will appear under structure

1

You would need to specify a url that beggins with /admin/structure for that matter (Drupal 7).

0

Here is the code snippet from simplenews module which shows implementation of hook_menu using multiple links

 /**
 * Implements hook_menu().
 */
function simplenews_menu() {
  $items['admin/content/simplenews'] = array(
    'title' => 'Newsletters',
    'description' => 'List newsletters and newsletter sent status.',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array('simplenews_admin_newsletter_issues'),
    'access arguments' => array('administer newsletters'),
    'file' => 'includes/simplenews.admin.inc',
  );
  $items['admin/config/services/simplenews'] = array(
    'title' => 'Newsletters',
    'description' => 'Configure your sites newsletters.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('simplenews_admin_categories'),
    'access arguments' => array('administer newsletters'),
    'file' => 'includes/simplenews.admin.inc',
  );


  $items['admin/config/services/simplenews/categories'] = array(
    'title' => 'Newsletters',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );

  .......


  return $items;
}

It clearly shows that you can do your work with

$items['admin/structure']=....
  • Which part of that code has anything to do with placing a link under admin/structure? – Clive Sep 12 '14 at 8:41
  • I think his primary issue is adding another link as he already added one so from above answer it is very simple to do just provide value for $items['admin/structure']=... – Ashish Bairagi Sep 12 '14 at 8:47
  • That isn't what he asked, though.. – Clive Sep 12 '14 at 8:52
  • might I misunderstood, edited my answer :) – Ashish Bairagi Sep 12 '14 at 8:56

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.