Answers.Body: <p>You need to either clear caches or menu rebuild: <a href="https://docs.civicrm.org/sysadmin/en/latest/troubleshooting/#rebuild-civicrm-menus" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/troubleshooting/#rebuild-civicrm-menus</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-28T16:58:12.813Z
Answers.Text: Thank you. I had been clearing caches but the Joomla ones not CiviCRM. So simple when you know how. Thanks
Answers.UserDisplayName: Crofter
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-28T15:46:18.347Z
Answers.LastActivityDate: 2020-02-28T15:46:18.347Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>There's 2 things that often get thought of as one and the same here.</p>
  
  <ol>
  <li><p>The "menu" route is specified in your XML file and makes it so if you type the URL correctly you'll get to your code.</p></li>
  <li><p>The "navigation menu" is usually populated via a hook made easier by civix. Here's an <a href="https://lab.civicrm.org/artfulrobot/groupgrowth/-/blob/master/groupgrowth.php#L160" rel="nofollow noreferrer">example</a> that adds an item called "Group Growth" under the Contacts menu.</p></li>
  </ol>
  
  <p>Changes to either of these usually need a cache clear as @Demerit says - I usually prefer <code>cv flush</code> if I'm on the command line, or <strong>Administer » System Settings » Cleanup Caches...*</strong></p>
  
  <p>If that's not working...</p>
  
  <ul>
  <li>checked your extension is enabled (!)</li>
  <li>check file permissions on your cache directories (e.g. <code>templates_c</code>) - sometimes if you've been working on the commandline and your webserver runs as a different user then you can end up locking CiviCRM out of being able to write files it needs to.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-28T16:59:48.970Z
Answers.Text: Thank you. I had been clearing caches but the Joomla ones not CiviCRM. I had been using your GoCardless extension as an example. Can you define the position in the menu or does it always get tacked on the end? Thanks
Answers.UserDisplayName: Crofter
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-28T17:01:11.260Z
Answers.Text: Ah, yep, that'll do it! Don't forget to mark one of the answers as accepted (with the ✔ button) so everyone knows you're sorted and don't need more answers.
Answers.UserDisplayName: artfulrobot
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-28T16:43:22.457Z
Answers.LastActivityDate: 2020-02-28T16:43:22.457Z
Answers.UserDisplayName: artfulrobot
Body: <p>I'm writing an extension to provide a dashboard of membership numbers specific to our organisation. I have created the extension using civix and edited the navigationMenu function to create a menu entry. I have also created the xxxx.xml file in xml/menu to map the url to the page_callback. Is there another step I need to do?</p>
  
  <p>The menu entry appears ok with the correct url but, when clicked, only displays the civicrm "home page" rather than my function. Is there a way to check if the xml file is being parsed correctly and the mapping stored? I checked civicrm_api3('Navigation', 'get'.. but I can't find entries for other extension menus so maybe this is the wrong place to look.</p>
  
  <p>Any help appreciated.</p>
  
Tags: <extension>
Title: Adding a menu entry from an extension
ThreadText: # Adding a menu entry from an extension
  
  (Asked by: username_0 on 2020-02-28)
  
  I'm writing an extension to provide a dashboard of membership numbers specific to our organisation. I have created the extension using civix and edited the navigationMenu function to create a menu entry. I have also created the xxxx.xml file in xml/menu to map the url to the page\_callback. Is there another step I need to do?
  
  The menu entry appears ok with the correct url but, when clicked, only displays the civicrm "home page" rather than my function. Is there a way to check if the xml file is being parsed correctly and the mapping stored? I checked civicrm\_api3('Navigation', 'get'.. but I can't find entries for other extension menus so maybe this is the wrong place to look.
  
  Any help appreciated.
  
  **Tags:** extension
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-02-28. Score: 2 | Accepted answer
  
  You need to either clear caches or menu rebuild: <https://docs.civicrm.org/sysadmin/en/latest/troubleshooting/#rebuild-civicrm-menus>
  
  > **Comments:**
  > **username_0**: Thank you. I had been clearing caches but the Joomla ones not CiviCRM. So simple when you know how. Thanks  
  
  ---
  
  ### Answer by username_2 on 2020-02-28. Score: 3
  
  There's 2 things that often get thought of as one and the same here.
  
  1. The "menu" route is specified in your XML file and makes it so if you type the URL correctly you'll get to your code.
  2. The "navigation menu" is usually populated via a hook made easier by civix. Here's an [example](https://lab.civicrm.org/username_2/groupgrowth/-/blob/master/groupgrowth.php#L160) that adds an item called "Group Growth" under the Contacts menu.
  
  Changes to either of these usually need a cache clear as @username_1 says - I usually prefer `cv flush` if I'm on the command line, or **Administer » System Settings » Cleanup Caches...\***
  
  If that's not working...
  
  * checked your extension is enabled (!)
  * check file permissions on your cache directories (e.g. `templates_c`) - sometimes if you've been working on the commandline and your webserver runs as a different user then you can end up locking CiviCRM out of being able to write files it needs to.
  
  > **Comments:**
  > **username_0**: Thank you. I had been clearing caches but the Joomla ones not CiviCRM. I had been using your GoCardless extension as an example. Can you define the position in the menu or does it always get tacked on the end? Thanks  
  > **username_2**: Ah, yep, that'll do it! Don't forget to mark one of the answers as accepted (with the ✔ button) so everyone knows you're sorted and don't need more answers.  
  
  ---
  
  