Ad

OctoberCMS Backend Sidemenu Does Not Appear

- 1 answer

I tried to creating sub-menu in Builder Plugin, however they do not appear under Contact Us

Setting backend menu using Builder Plugin

You can see there should be two sub-menus appearing, but none of them shown.

This is the plugin.yaml

navigation:
    contact-us:
        label: 'stephenli.contactus::lang.plugin.name'
        url: stephenli/contactus/info
        icon: icon-life-ring
        sideMenu:
            contact-us-jumbotron:
                label: 'FAQ Top Jumbotron'
                url: stephenli/contactus/jumbotron
                icon: icon-sitemap
            contact-us-info:
                label: Information
                url: stephenli/contactus/info
                icon: icon-sitemap

Cannot think of why this is happening. Please request if more information is needed. Thanks!

Ad

Answer

May be you are missing menu context for controller.

did you add this to controller

BackendMenu::setContext('StephenLi.ContactUs', 'contact-us');

if not please add this line in controller constructor.

like this

public function __construct()
{
    parent::__construct();
    BackendMenu::setContext('StephenLi.ContactUs', 'contact-us');
}

if still its not working please comment.

Ad
source: stackoverflow.com
Ad