Customer area menu items

twisted1919

Administrator
Staff member
@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.
 

corey34

Active Member
@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
 

twisted1919

Administrator
Staff member
@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.
 

corey34

Active Member
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,
                    )
                ),
            ),
.......
 

twisted1919

Administrator
Staff member
@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),
    ),
),
...
 

nemesis82

Member
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
 

twisted1919

Administrator
Staff member
I can create a menu item pointing a php file in the same directory of the extension ?
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.
 
Top