【问题标题】:OctoberCMS backend sidemenu does not appear十月CMS后端侧边菜单不出现
【发布时间】:2018-01-27 16:50:32
【问题描述】:

我尝试在 Builder Plugin 中创建子菜单,但它们没有出现在“联系我们”下

您可以看到应该出现了两个子菜单,但没有一个显示。

这是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

想不出为什么会这样。如果需要更多信息,请索取。谢谢!

【问题讨论】:

    标签: octobercms


    【解决方案1】:

    您可能缺少menu contextcontroller

    你有没有把它添加到控制器中

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

    如果不是请在controller constructor中添加这一行。

    喜欢这个

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

    如果还是不行请评论。

    【讨论】:

    • 感谢 Hardik,它工作得很好。我想我最好自己编写后端代码,而不是在下一个项目中依赖 Builder。
    • builder 将只构建一次 controller and model,因此您需要 code them manually after once created,对于 menu add/updateform fields,您可以在 builderrely >
    • 所以最好用它来启动东西然后手动编码
    • 是的,您可以使用 builder 启动,然后尽力而为 :)
    猜你喜欢
    • 2017-09-07
    • 2018-02-28
    • 1970-01-01
    • 1970-01-01
    • 2014-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多