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 990783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:59:49+00:00 2026-05-16T05:59:49+00:00

I’m using the content profile module. When a user is on their view profile

  • 0

I’m using the content profile module. When a user is on their view profile page and press edit, they expect the profile edit page to show, not account settings as it is now. The path to content profile edit page is ‘user/%/edit/uprofile’. Does anyone know how to set the ‘user/%/edit/uprofile’ to default tab for ‘user/%/edit’?

  • 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-16T05:59:50+00:00Added an answer on May 16, 2026 at 5:59 am

    Edit 2 (for Content Profile)

    This example is for a Content Profile tab. Just change $type to the short name of the content type for the profile. This also shows how to clean up the code for real-world use (my previous examples were really, really verbose):

    function mymodule_menu_alter(&$items) {
      // Specify the content profile type you'd like to work with
      $type = 'profile';
    
      // Make sure the user has a Content Profile to edit
      if (!empty($items['user/%user_category/edit/' . $type])) {
        // Pull out the menu items we want to modify.
        $account  = &$items['user/%user_category/edit/account'];
        $edit     = &$items['user/%user_category/edit'];
        $profile  = &$items['user/%user_category/edit/' . $type];
    
        // Specify the Edit Account page as just a regular tab. 
        // You do not need to change this block: this will always be the same as long 
        // as you don't want Edit account to be the default tab.
        $account = array(
          'type' => MENU_LOCAL_TASK,
          'page callback' => $edit['page callback'],
          'page arguments' => $edit['page arguments'],
          'access callback' => $edit['access callback'],
          'access arguments' => $edit['access arguments'],
          'module' => $edit['module'],
          'file' => $edit['file'],
        ) + $account;
    
        // Change the default action to take when hitting user/<UID>/edit to
        // the content profile
        $edit = array(
          'page callback' => $profile['page callback'],
          'page arguments' => $profile['page arguments'],
          'access callback' => $profile['access callback'],
          'access arguments' => $profile['access arguments'],
          'file' => $profile['file'],
          'file path' => $profile['file path'],
        ) + $edit;
    
        // Specify the profile page as the default tab and remove settings
        // already set above
        $profile['type'] = MENU_DEFAULT_LOCAL_TASK;
        unset($profile['page callback'], 
          $profile['page arguments'], 
          $profile['access callback'], 
          $profile['access arguments'], 
          $profile['file'], 
          $profile['file path']);
      }
    }
    

    Edit 1 (for Core’s Profile module)

    I didn’t realize you wanted to change the default tabs under Edit. It’s the same general principle as I described below, but with some minor modifications. This example will make the Personal tab (at user/<UID>/edit/Personal) default instead of the account tab:

    function mymodule_menu_alter(&$items) {
      // Specify the Edit Account page as just a regular tab. 
      // You do not need to change this block: this will always be the same as long 
      // as you don't want Edit account to be the default tab.
      $items['user/%user_category/edit/account']['type'] = MENU_LOCAL_TASK;
      $items['user/%user_category/edit/account']['page callback'] = $items['user/%user_category/edit']['page callback'];
      $items['user/%user_category/edit/account']['page arguments'] = $items['user/%user_category/edit']['page arguments'];
      $items['user/%user_category/edit/account']['access callback'] = $items['user/%user_category/edit']['access callback'];
      $items['user/%user_category/edit/account']['access arguments'] = $items['user/%user_category/edit']['access arguments'];
      $items['user/%user_category/edit/account']['module'] = $items['user/%user_category/edit']['module'];
      $items['user/%user_category/edit/account']['file'] = $items['user/%user_category/edit']['file'];
    
      // Change default action to take when hitting user/<UID>/edit to
      // the settings of the page you want to use.
      // -- Custom settings start here --
      $items['user/%user_category/edit']['page callback'] = $items['user/%user_category/edit/Personal']['page callback'];
      $items['user/%user_category/edit']['page arguments'] = $items['user/%user_category/edit/Personal']['page arguments'];
      $items['user/%user_category/edit']['access callback'] = $items['user/%user_category/edit/Personal']['access callback'];
      $items['user/%user_category/edit']['access arguments'] = $items['user/%user_category/edit/Personal']['access arguments'];
      $items['user/%user_category/edit']['module'] = $items['user/%user_category/edit/Personal']['module'];
      $items['user/%user_category/edit']['file'] = $items['user/%user_category/edit/Personal']['file'];
    
      // When loading a profile tab, user_edit needs two parameters. The second parameter is the name of the profile
      // (i.e. Personal from user/<UID>/edit/Personal).
      $items['user/%user_category/edit']['page arguments'] = array(1, 'Personal');
    
      // Specify the Personal page as the default tab and remove settings
      // already set above */
      $items['user/%user_category/edit/Personal']['type'] = MENU_DEFAULT_LOCAL_TASK;
      unset($items['user/%user_category/edit/Personal']['page callback']);
      unset($items['user/%user_category/edit/Personal']['page arguments']);
      unset($items['user/%user_category/edit/Personal']['access callback']);
      unset($items['user/%user_category/edit/Personal']['access arguments']);
      unset($items['user/%user_category/edit/Personal']['module']);
      unset($items['user/%user_category/edit/Personal']['file']);
    }
    

    Overview and Concept

    You can do this with hook_menu_alter and changing the types for specific tabs.

    Changing the default tab is a little bit of a harrowing process. Basically, the default tab inherits all the properties of the page without any tabs selected. This allows a user to go to user/UID and get the view page without having to go directly to user/UID/view.

    To get a clearer understanding of this, check out the user_menu() hook implementation. Note how $items['user/%user/view'] is pretty empty, and $items['user/%user_uid_optional'] contains all the settings you would’ve expected to see under $items['user/%user/view'].

    So, you’re going to first set up the view tab to act as a regular tab: to do this, you’re going to have to copy all the settings that are attached to the user/UID menu item and put them into the user/UID/view menu item.

    Once you do that, you’re going to replace the settings for user/UID with the settings for the tab you want to become the default tab.

    Finally, you’re going to unset all the menu items for the default tab since it will inherit the settings for user/UID.

    Check out this code which makes the Edit tab default:

    function mymodule_menu_alter(&$items) {
      // Specify the View page as just a regular tab. 
      // You do not need to change this block: this will always be the same as long 
      // as you don't want View to be the default tab.
      $items['user/%user/view']['type'] = MENU_LOCAL_TASK;
      $items['user/%user/view']['page callback'] = $items['user/%user_uid_optional']['page callback'];
      $items['user/%user/view']['page arguments'] = $items['user/%user_uid_optional']['page arguments'];
      $items['user/%user/view']['access callback'] = $items['user/%user_uid_optional']['access callback'];
      $items['user/%user/view']['access arguments'] = $items['user/%user_uid_optional']['access arguments'];
      $items['user/%user/view']['file'] = $items['user/%user_uid_optional']['file'];
    
      // Normal tabs don't have a weight
      unset($items['user/%user/view']['weight']);
    
      // Change default action to take when hitting user/<UID> to
      // the settings of the page you want to use.
      // -- Custom settings start here --
      $items['user/%user_uid_optional']['page callback'] = $items['user/%user_category/edit']['page callback'];
      $items['user/%user_uid_optional']['page arguments'] = $items['user/%user_category/edit']['page arguments'];
      $items['user/%user_uid_optional']['access callback'] = $items['user/%user_category/edit']['access callback'];
      $items['user/%user_uid_optional']['access arguments'] = $items['user/%user_category/edit']['access arguments'];
      $items['user/%user_uid_optional']['file'] = $items['user/%user_category/edit']['file'];
    
      // Specify the Edit page as the default tab and remove settings
      // already set above
      $items['user/%user_category/edit']['type'] = MENU_DEFAULT_LOCAL_TASK;
      $items['user/%user_category/edit']['weight'] = -10;
      unset($items['user/%user_category/edit']['page callback']);
      unset($items['user/%user_category/edit']['page arguments']);
      unset($items['user/%user_category/edit']['access callback']);
      unset($items['user/%user_category/edit']['access arguments']);
      unset($items['user/%user_category/edit']['file']);
    }
    

    Replace the second part of the function with the settings for your menu item and you should be in good shape. Of course, remember to clear the cache after making any menu changes for them to take effect.

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

Sidebar

Ask A Question

Stats

  • Questions 502k
  • Answers 502k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think you want any ten students with each birthdate.… May 16, 2026 at 2:31 pm
  • Editorial Team
    Editorial Team added an answer Does it work with an explicit cast? if (id) Cache.insert(make_pair<int,… May 16, 2026 at 2:31 pm
  • Editorial Team
    Editorial Team added an answer You've misunderstood prepared statements in PDO, in the class News,… May 16, 2026 at 2:31 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
In order to apply a triggered animation to all ToolTip s in my app,
I want use html5's new tag to play a wav file (currently only supported
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

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.