Customer area menu items

Discussion in 'Extensions' started by twisted1919, Dec 28, 2014.

  1. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,680
    Likes Received:
    2,254
    @prazze - When you click the articles link, you are redirected in frontend, that is an area opened to everyone, not just to people that are logged in, therefore, the frontend does not have a left side sidebar.
     
  2. corey34

    corey34 Active Member

    Joined:
    Dec 24, 2016
    Messages:
    249
    Likes Received:
    32
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    3
    @twisted1919, how do you create the submenu effect on the sidebar menu? I found here, how to create the submenus, but it looks like you have some script that runs on a click or the parent menu. How do you apply that?

    Thanks
     
  3. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,680
    Likes Received:
    2,254
    @corey34 - you shouldn't be concerned about that, if you add sub-items to your menu item, then mailwizz should take care of the rest for you. If it doesn't, share the code and we'll see why not.
     
  4. corey34

    corey34 Active Member

    Joined:
    Dec 24, 2016
    Messages:
    249
    Likes Received:
    32
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    3
    OK, here is what I did:

    Code:
    $newItems = array();
        $_newItems  = array(
            array(
                    'name'      => Yii::t('app', 'Profile Settings'),
                    'icon'      => 'glyphicon-user',
                    'active'    => 'api_keys',
                    'route'     => null,
                    'items'=>array(
                        array(
                            'name'      => Yii::t('app', 'Blog'),
                            'icon'      => 'glyphicon-pencil',
                            'active'    => 'api_keys',
                            'route'     => 'https://website.com/blog',
                            'active'    => false,
                        ),
                        array(
                            'name'      => Yii::t('app', 'Events'),
                            'icon'      => 'glyphicon-calendar',
                            'active'    => 'api_keys',
                            'route'     => 'https://website.com/event',
                            'active'    => strpos($route, 'https://website.com/event') === 0,
                        )
                    ),
                ),
    .......
     
  5. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,680
    Likes Received:
    2,254
    @corey34 - an inner item should look like:
    PHP:
    // taken from:/apps/backend/components/web/widgets/LeftSideNavigationWidget.php
    ...
    'monetization' => array(
        
    'name'      => Yii::t('app''Monetization'),
        
    'icon'      => 'glyphicon-credit-card',
        
    'active'    => array('payment_gateway''price_plans''orders''promo_codes''currencies''taxes'),
        
    'route'     => null,
        
    'items'     => array(
            array(
    'url' => array('payment_gateways/index'), 'label' => Yii::t('app''Payment gateways'), 'active' => strpos($route'payment_gateway') === 0),
            array(
    'url' => array('price_plans/index'), 'label' => Yii::t('app''Price plans'), 'active' => strpos($route'price_plans') === 0),
            array(
    'url' => array('orders/index'), 'label' => Yii::t('app''Orders'), 'active' => strpos($route'orders') === 0),
            array(
    'url' => array('promo_codes/index'), 'label' => Yii::t('app''Promo codes'), 'active' => strpos($route'promo_codes') === 0),
            array(
    'url' => array('currencies/index'), 'label' => Yii::t('app''Currencies'), 'active' => strpos($route'currencies') === 0),
            array(
    'url' => array('taxes/index'), 'label' => Yii::t('app''Taxes'), 'active' => strpos($route'taxes') === 0),
        ),
    ),
    ...
     
    kosir likes this.
  6. corey34

    corey34 Active Member

    Joined:
    Dec 24, 2016
    Messages:
    249
    Likes Received:
    32
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    3
    twisted1919 likes this.
  7. Napoolion

    Napoolion Member

    Joined:
    Dec 29, 2014
    Messages:
    91
    Likes Received:
    10
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    @twisted1919
    Is the solution still working today? I uploaded the extension, it seemed to do nothing.

    Thanks!
     
  8. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,680
    Likes Received:
    2,254
    @Napoolion - It should still work, nothing changed in the way menus work.
     
  9. Amit Jugran

    Amit Jugran New Member

    Joined:
    Feb 4, 2017
    Messages:
    6
    Likes Received:
    1
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    Hi @twisted1919 ,

    And how do you remove a sub-menu item? I want to remove couple of sub-menu items (Autoresponder and Geo Opens) under Campaigns.

    Thanks.
     
  10. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,680
    Likes Received:
    2,254
    @Amit Jugran - You just loop over them and then you unset their array index...
     
  11. nemesis82

    nemesis82 Member

    Joined:
    Sep 19, 2018
    Messages:
    43
    Likes Received:
    3
    S.E:
    2019-09-17 13:35:43
    L.T:
    Regular
    L.C:
    1
    Hi all, a simple question.
    I can create a menu item pointing a php file in the same directory of the extension ? If yes, in which way I can do ?
    Thanks
     
  12. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,680
    Likes Received:
    2,254
    Don't do that. Register a controller and then add a menu item pointing to the registered controller. Have a look at the support tickets extension or backup manager extension to see how they register routes in menus.
     

Share This Page