Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>After much trial and error, I was able to get a page working as a child of the <code>user/%/edit</code> path using code like this:</p> <pre><code>&lt;?php /** * Implementation of hook_menu(). */ function noc_profile_privacy_menu() { return array( 'user/%user_category/edit/privacy' =&gt; array( 'title' =&gt; 'Portfolio privacy', 'page callback' =&gt; 'drupal_get_form', 'page arguments' =&gt; array('noc_profile_privacy_form', 1), 'access callback' =&gt; 'content_profile_page_access', 'access arguments' =&gt; array('profile', 1), 'type' =&gt; MENU_LOCAL_TASK, 'load arguments' =&gt; array('%map', '%index'), ), ); } /** * Implementation of hook_user(). */ function noc_profile_privacy_user($op, &amp;$edit, &amp;$account, $category = NULL) { if ($op === 'categories') { return array(array( 'name' =&gt; 'privacy', 'title' =&gt; t('Profile privacy'), 'weight' =&gt; 0, )); } } </code></pre> <p>Note that the <code>'name'</code> key of what I'm returning in hook_user() is the same as what comes after <code>user/%user/category/edit</code> in my hook_menu() definition. I believe that is key. You will also get an error if you omit the <code>'load arguments'</code> item, with exactly that value.</p> <p>So I believe what the user category is is the <code>'privacy'</code> in my case - the bit after <code>edit</code> in the path of the menu item definition.</p> <p>Is this an unnecessary complication? Yes, so it seems.</p> <p>Edit: I see my co-worker hefox beat me to replying to this question. I wouldn't have been able to figure all of this out without Fox's help, so mad props to the Fox.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload