add tab in users menu with url link

Discussion in 'Templates customization' started by sarah_rendle, Apr 17, 2014.

  1. sarah_rendle

    sarah_rendle Member

    Joined:
    Apr 3, 2014
    Messages:
    69
    I have followed the instructions to add a tab in the users menu but instead of adding a page I simple with for the tab to be linked with my website

    Can anyone help me please. What instructions do I need to add to the site.php to create a tab with a url link ?
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    You can do it same way http://www.amember.com/docs/How_to_customize_user_tabs_in_member's_area
    Code:
    Am_Di::getInstance()->hook->add('userMenu', 'siteUserMenu');
    function siteUserMenu(Am_Event $event)
    {
          // $user = $event->getUser(); // if required
          $menu = $event->getMenu();
     
          // Add a single tab
          $menu->addPage(array(
                  'id' => 'mypage',
                  'label' => ___('Do The Thing'),
                  'uri' => '/the.thing',
                  'order' => 2,
          ));
    }
    
    You can see uri parameter in code. It is url of your page on site.
  3. sarah_rendle

    sarah_rendle Member

    Joined:
    Apr 3, 2014
    Messages:
    69
    perfect thank you...

Share This Page