【问题标题】:I want to add a custom png image instead of glyphicon in admin menu section in opencart 2.3x and 3x?我想在 opencart 2.3x 和 3x 的管理菜单部分添加自定义 png 图像而不是 glyphicon?
【发布时间】:2019-09-05 10:43:23
【问题描述】:

如何在 column_left 控制器中更新它?

 if ($catalog) {
      $data['menus'][] = array(
     'id'       => 'menu-catalog',
     'icon'    => 'fa-tags', 
     'name'    => $this->language->get('text_catalog'),
     'href'     => '',
     'children' => $catalog
     );     
 }

【问题讨论】:

    标签: opencart opencart-3 opencart-module opencart2.3


    【解决方案1】:

    你不能,因为它是为每个菜单硬编码的,

    即使你设法完成了这项工作,你安装的其他一些扩展仍然需要更新修复

    在左列控制器中 'icon' => 'fa-tags',把它改成 'icon' => 'glyphicon glyphicon-user'

    没有什么可以改变的,它会起作用的,

    【讨论】:

      【解决方案2】:

      您应该在“admin/view/template/common/column_left.twig”中自定义html

      例如..替换此代码:

      {% if menu.href %}<a href="{{ menu.href }}"><i class="fa {{ menu.icon }} fw"></i> {{ menu.name }}</a>
      

      作者:

      {% if menu.href %}{% if menu.img %}<a href="{{ menu.href }}"><img src="{{ menu.img }}"> {{ menu.name }}</a>{% else %}<a href="{{ menu.href }}"><i class="fa {{ menu.icon }} fw"></i> {{ menu.name }}</a>{% endif %}
      

      并在 column_left 控制器的菜单数组项中添加图像路径:

      'img' => 'view/image/file.png'
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-02-11
        • 1970-01-01
        • 2012-09-11
        • 2023-03-20
        • 2019-12-13
        • 1970-01-01
        相关资源
        最近更新 更多