Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3333496
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:48:11+00:00 2026-05-17T23:48:11+00:00

I’m creating a module that let’s your users add feeds. So i want my

  • 0

I’m creating a module that let’s your users add feeds.
So i want my code to provide tabs that can be overwritten at the theme layer.

I thought this could be done with the hook_menu:

$items['tab_add_feed'] = array(
  'title' => 'Add Feed',
  'page callback' => 'xml_parser_add_feed',
  'access callback' => 'user_access',
  'access arguments' => array('manage own feeds'),
  'type' => MENU_LOCAL_TASK,
);

something like the above.
But I’m using it on the front side of the site.

How can i add tabs or links on top of my page the drupal way?

//edit

There are none tabs present at the moment, maybe i have to make them visible?

fixed it by adding <a href="xml_parser/add_feed">add feed</a> to the main page callback function
But this is ugly, hard coded and not theme-able. waiting for a better solution.

//edit

This is the code i am using now

function xml_parser_menu() {
    $items = array();

    $items['xml_parser'] = array(
            'path' => 'xml_parser',
            'title' => t('Feed'),
            'description' => t('Add/edit feeds'),
            'page callback' => 'xml_parser_manage_overview', 
            'access callback' => 'user_access', // get user access
            'access arguments' => array('manage own feeds'), // check user if premission is set
            'type' => MENU_NORMAL_ITEM,
            'menu_name' => 'primary-links', // add to primary menu
    );

    $items['xml_parser/add_feed'] = array(
            'path' => 'xml_parser/add_feed',
            'title' => 'Add Feed',
            'page callback' => 'xml_parser_add_feed',
            'access callback' => 'user_access',
            'access arguments' => array('manage own feeds'),
            //'access' => user_access('maintain own subscriptions'),
            'type' => MENU_LOCAL_TASK,
    );
    return $items;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:48:12+00:00Added an answer on May 17, 2026 at 11:48 pm

    I think the name of the item would be something like ‘user/%/add_feed’, with the % argument being the user id. Also, the access callback is spelled incorrectly, should be user_access. This should create a tab for a user on the user profile page. You could also do node/%/add_feed to add a tab to a node.

    While developing this module, you may find it useful to also use this:

    function mymodule_init() {
       cache_clear_all();
       menu_router_build();
    }
    

    Until you get the menu straight.

    If you want to just add an arbitrary tab to a page to add a feed, it would probably be an autonomous menu or a themed link. I would need to know more about the context of the feeds you are trying to provide and how users are subscribing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.