Answers.Body: <p>I just figured it out. The following line:</p>
  
  <pre><code>_serving_civix_insert_navigation_menu($menu, NULL, array(
  </code></pre>
  
  <p>should have the name of the parent menu passed as:</p>
  
  <pre><code>_serving_civix_insert_navigation_menu($menu, 'Memberships', array(
  </code></pre>
  
  <p>That will place the menu item within the existing "Memberships" menu. </p>
  
  <p>Anyone know how to change the position of the menu item?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-10T19:02:39.070Z
Answers.LastActivityDate: 2018-07-10T19:02:39.070Z
Answers.UserDisplayName: Sleewok
Answers.Body: <p>Example:</p>
  
  <pre><code>/**
   * Implements hook_civicrm_navigationMenu().
   *
   * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_navigationMenu/
   */
  function dmfactuurlink_civicrm_navigationMenu(&amp;$menu) {
  
    _dmfactuurlink_civix_insert_navigation_menu($menu, 'Administer', array(
      'label' =&gt; E::ts('Domus Medica Factuur Link Instellingen'),
      'name' =&gt; 'dmafctuurlink_setting',
      'url' =&gt; 'civicrm/dmfactuurlink/form/setting',
      'permission' =&gt; 'administer CiviCRM',
      'attributes' =&gt; [],
      'operator' =&gt; 'OR',
      'separator' =&gt; 0,
    ));
    _dmfactuurlink_civix_navigationMenu($menu);
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-14T20:40:20.063Z
Answers.Text: Is there a specific part of this that lets me change the position (weight) of the link within the menu hierarchy?
Answers.UserDisplayName: Sleewok
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-07T07:38:40.937Z
Answers.LastActivityDate: 2019-01-07T07:38:40.937Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I'm trying to add a menu item for my extension to the existing "Memberships" menu. The documentation suggests the following:</p>
  
  <blockquote>
    <p>Use the Civix implementation</p>
    
    <p>Civix comes with helper functions
    _EXTENSION_NAME_civix_insert_navigation_menu and _EXTENSION_NAME_civix_navigation_menu that simplify the process of inserting menu items. Consider using these functions rather than using
    the examples below or writing your own implementation of this hook.</p>
  </blockquote>
  
  <p>What it doesn't do is give you any clue how to do this. I found an example here: <a href="https://github.com/totten/civix/blob/master/UPGRADE.md" rel="nofollow noreferrer">https://github.com/totten/civix/blob/master/UPGRADE.md</a>. </p>
  
  <p>Regardless, there is no info on how to actually add a menu item to an existing menu using this method. </p>
  
  <p><strong>Could someone please enlighten me on how to use the civix method to add a menu item as a child to an existing menu?</strong></p>
  
Tags: <extension><menu><civix>
Title: How to Add Menu Item to Parent Using Civix
ThreadText: # How to Add Menu Item to Parent Using Civix
  
  (Asked by: username_0 on 2018-07-10)
  
  I'm trying to add a menu item for my extension to the existing "Memberships" menu. The documentation suggests the following:
  
  > Use the Civix implementation
  >
  > Civix comes with helper functions
  > \_EXTENSION\_NAME\_civix\_insert\_navigation\_menu and \_EXTENSION\_NAME\_civix\_navigation\_menu that simplify the process of inserting menu items. Consider using these functions rather than using
  > the examples below or writing your own implementation of this hook.
  
  What it doesn't do is give you any clue how to do this. I found an example here: <https://github.com/totten/civix/blob/master/UPGRADE.md>.
  
  Regardless, there is no info on how to actually add a menu item to an existing menu using this method.
  
  **Could someone please enlighten me on how to use the civix method to add a menu item as a child to an existing menu?**
  
  **Tags:** extension, menu, civix
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-01-07. Score: 3 | Accepted answer
  
  Example:
  /**
   * Implements hook_civicrm_navigationMenu().
   *
   * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_navigationMenu/
   */
  function dmfactuurlink_civicrm_navigationMenu(&$menu) {
  
    _dmfactuurlink_civix_insert_navigation_menu($menu, 'Administer', array(
      'label' => E::ts('Domus Medica Factuur Link Instellingen'),
      'name' => 'dmafctuurlink_setting',
      'url' => 'civicrm/dmfactuurlink/form/setting',
      'permission' => 'administer CiviCRM',
      'attributes' => [],
      'operator' => 'OR',
      'separator' => 0,
    ));
    _dmfactuurlink_civix_navigationMenu($menu);
  }
  
  > **Comments:**
  > **username_0**: Is there a specific part of this that lets me change the position (weight) of the link within the menu hierarchy?  
  
  ---
  
  ### Answer by username_0 on 2018-07-10. Score: 1
  
  I just figured it out. The following line:
  _serving_civix_insert_navigation_menu($menu, NULL, array(
  
  should have the name of the parent menu passed as:
  _serving_civix_insert_navigation_menu($menu, 'Memberships', array(
  
  That will place the menu item within the existing "Memberships" menu. 
  Anyone know how to change the position of the menu item?
  
  
  ---
  
  