Answers.Body: <p>One way to do this is:</p>
  <ol>
  <li>Create an extension.</li>
  <li>Make up a url like <code>civicrm/mymenu/contactrecord</code>.</li>
  <li><a href="https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-page" rel="nofollow noreferrer">Create a page</a> for your extension that uses your url, e.g. <code>civix generate:page MyPage civicrm/mymenu/contactrecord</code></li>
  <li>Inside the page run() method, put code that does <code>CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/view', 'reset=1&amp;cid=' . CRM_Core_Session::getLoggedInContactID()));</code></li>
  <li>You might want to check if the logged in contact is null first and do something else.</li>
  </ol>
  <p>Now anyone can visit /civicrm/mymenu/contactrecord and it will go to their contact record.</p>
  <hr />
  <p>Lastly, I know you're on wordpress, but for others for drupal there is <a href="https://github.com/compucorp/uk.co.compucorp.usermenu" rel="nofollow noreferrer">https://github.com/compucorp/uk.co.compucorp.usermenu</a> which adds a menu with a link but note that it goes to the <em>drupal user</em> account, not the civi contact record.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-25T14:44:33.247Z
Answers.Text: My question should have been (EDITED) how to replace <contact-id> in the URL to create the menu: https://domain.net/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview&reset=1&cid=<contact_id>. Is this possible?
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-25T15:07:22.830Z
Answers.Text: Maybe I'm not understanding. Are you asking "How do I make a civicrm extension to insert a custom menu link"? And I'm not clear now on what you meant by "From wordpress using custom php it's easy" - before I thought you meant you already have a way to make the menu link, but just need to know how to get the logged in user's contact id.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-25T16:55:25.700Z
Answers.Text: My need is actually to add a new Menu to the Menu bar that brings to one's own profile.
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-25T17:35:30.817Z
Answers.Text: Ok have updated answer.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-27T10:11:50.190Z
Answers.Text: great! we start immediately :-) I thought first it was possible through the UI but an extension is also ok. thanks
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-25T13:15:04.790Z
Answers.LastActivityDate: 2021-10-25T17:35:20.417Z
Answers.LastEditDate: 2021-10-25T17:35:20.417Z
Answers.UserDisplayName: Demerit
Body: <p>For a registered user, he will need on WordPress to navigate through the WP top bar, go to his profile and then click on 'CiviCRM Profile' to access his own contact. The CiviCRM link in Breadcrumb brings to the dashboard but I need them to access their own contact.</p>
  <p>I'm looking for a way to make this easier and accessible through the CiviCRM menu bar.  I know how to add a custom link but how can I customize the link based on:</p>
  <p><a href="https://domain.net/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fcontact%2Fview&amp;reset=1&amp;cid=" rel="nofollow noreferrer">https://domain.net/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fcontact%2Fview&amp;reset=1&amp;cid=</a>&lt;contact_id&gt;</p>
  <p>From wordpress using custom php it's easy but once connected, how does it work?</p>
  <p>How do I make the &lt;contact_id&gt; variable being replaced in the URL?</p>
  
Tags: <custom>
Title: How can I add a link in main menu to view own contact summary?
ThreadText: # How can I add a link in main menu to view own contact summary?
  
  (Asked by: username_0 on 2021-10-22)
  
  For a registered user, he will need on WordPress to navigate through the WP top bar, go to his profile and then click on 'CiviCRM Profile' to access his own contact. The CiviCRM link in Breadcrumb brings to the dashboard but I need them to access their own contact.
  
  I'm looking for a way to make this easier and accessible through the CiviCRM menu bar. I know how to add a custom link but how can I customize the link based on:
  
  <https://domain.net/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview&reset=1&cid=><contact\_id>
  
  From wordpress using custom php it's easy but once connected, how does it work?
  
  How do I make the <contact\_id> variable being replaced in the URL?
  
  **Tags:** custom
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-10-25. Score: 1 | Accepted answer
  
  One way to do this is:
  
  1. Create an extension.
  2. Make up a url like `civicrm/mymenu/contactrecord`.
  3. [Create a page](https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-page) for your extension that uses your url, e.g. `civix generate:page MyPage civicrm/mymenu/contactrecord`
  4. Inside the page run() method, put code that does `CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . CRM_Core_Session::getLoggedInContactID()));`
  5. You might want to check if the logged in contact is null first and do something else.
  
  Now anyone can visit /civicrm/mymenu/contactrecord and it will go to their contact record.
  
  ---
  
  Lastly, I know you're on wordpress, but for others for drupal there is <https://github.com/compucorp/uk.co.compucorp.usermenu> which adds a menu with a link but note that it goes to the *drupal user* account, not the civi contact record.
  
  > **Comments:**
  > **username_0**: My question should have been (EDITED) how to replace <contact-id> in the URL to create the menu: https://domain.net/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview&reset=1&cid=<contact_id>. Is this possible?  
  > **username_1**: Maybe I'm not understanding. Are you asking "How do I make a civicrm extension to insert a custom menu link"? And I'm not clear now on what you meant by "From wordpress using custom php it's easy" - before I thought you meant you already have a way to make the menu link, but just need to know how to get the logged in user's contact id.  
  > **username_0**: My need is actually to add a new Menu to the Menu bar that brings to one's own profile.  
  > **username_1**: Ok have updated answer.  
  > **username_0**: great! we start immediately :-) I thought first it was possible through the UI but an extension is also ok. thanks  
  
  ---
  
  