【问题标题】:ExpressionEngine Custom Control Panel tab not workingExpressionEngine 自定义控制面板选项卡不起作用
【发布时间】:2021-05-07 02:31:41
【问题描述】:

我正在尝试向我的发布条目表单添加一个选项卡,我有以下代码(为简单起见已删减),但它不起作用:

在 tab.my_module.php 中:

public function display($channel_id, $entry_id = '')
{
    $settings = array();

    $settings = array(
        'custom_field' => array(
            'field_id'      => 'custom_field',
            'field_label'       => 'custom_field',
            'field_type'        => 'text'
        )
    );

    return $settings;
}

在 upd.my_module.php 中:

public function install() {
    ee()->layout->add_layout_tabs($this->tabs(), 'my_module');
}

  public function tabs()
  {
      $tabs['my_module'] = array(
      'custom_field'=> array(
            'visible'   => 'true',
            'collapse'  => 'false',
            'htmlbuttons'   => 'true',
            'width'     => '100%'
            ),
      );

      return $tabs;
  }

但是我重新安装模块后hte选项卡没有出现,我错过了什么?

【问题讨论】:

    标签: module expressionengine


    【解决方案1】:

    问题是由 lang 文件中的样式信息引起的!

    新标签实际上已包含在“发布”和“编辑”页面中,但标签标题中的样式不知何故导致新标签被隐藏。

        $lang = array(
            'module_name'     => 'My Module',
            'module_description'  => 'Brief description ',
            'save_btn' => 'Save',
            'save_btn_clicked' => 'Clicked',
            'module_name' => '<style color="green">My Module</style>',
        );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-28
      • 1970-01-01
      相关资源
      最近更新 更多