2016-04-14 9 views
1

静的ページプラグインのメニューフォームにカスタムフィールド「サムネイル」を追加します。10月のCMS静的ページプラグインにカスタムフィールドを追加する方法は?

Iすでにプロジェクトにこのフィールドを追加/プラグイン/ rainlab /ページ/クラス/メニュー項目/ fields.yaml

# =================================== 
# Field Definitions 
# =================================== 

fields: 

    title: 
     span: left 
     label: rainlab.pages::lang.menuitem.title 

    type: 
     span: right 
     label: rainlab.pages::lang.menuitem.type 
     type: dropdown 

    url: 
     label: rainlab.pages::lang.menuitem.url 

    reference: 
     label: rainlab.pages::lang.menuitem.reference 
     type: dropdown 
     cssClass: input-sidebar-control 

    thumbnail: 
     label: Thumbnail 
     mode: file 
     cssClass: input-sidebar-control 
     type: mediafinder 

// another part of code is default 

はまた

プロジェクト/プラグイン/ rainlab /ページ/クラス/ MenuItem.phpにを追加します
public $thumbnail; 

public $fillable = [ 
    'title', 
    'nesting', 
    'type', 
    'url', 
    'code', 
    'reference', 
    'cmsPage', 
    'replace', 
    'viewBag', 
    'thumbnail' // new field 
]; 

しかし、動作しません。この問題を解決するには?ありがとうございました。フィールドのシンプルなタイプの場合

答えて

0

MenuItemsEditor.prototype.applyMenuItem 

変更basicProperties

basicProperties = { 
      'title': 1, 
      'type': 1, 
      'code': 1, 
      'thumbnail': 1 
     }, 
機能に

plugins/rainlab/pages/formwidgets/menuitems/assets/js/menu-items-editor.js 

ファイルjsの変更必要

しかし、ファイルの場合は動作しません。

関連する問題