#3029 closed enhancement (fixed)
テンプレート拡張の際、拡張対象のテンプレートを設定ファイルで設定する形に変更
Reported by: | ebihara | Owned by: | ebihara |
---|---|---|---|
Priority: | major | Milestone: | OpenPNE3alpha3 |
Component: | 指定しない | Version: | |
Keywords: | Cc: |
Description
現在は拡張対象のテンプレートを、テンプレートのファイル名で特定しているが、これを設定ファイルできめ細かく指定できるような形に変更する。
Change History (4)
comment:1 Changed 14 years ago by
Owner: | changed from nobody to ebihara |
---|---|
Status: | new → assigned |
comment:2 Changed 14 years ago by
comment:3 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
r8543, r8547, r8548, r8553 で対応しました。
この修正により、 アプリケーションもしくはモジュール内の view.yml に対し以下のような記述をおこなうことで、テンプレート拡張がおこなえるようになりました。
all: # すべてのページが対象 customize: sample1: template: member/sample1 # member/sample1 という指定で取得できるパーシャルを挿入する category: diary # diary カテゴリが設定されているパーツに対してのみ挿入する parts: exampleParts # exampleParts という ID を持つパーツに対してのみ挿入する target: bottom # 条件に当てはまるパーツの bottom に挿入する loginSuccess: # loginSuccess アクションが対象 customize: sample2: # template を省略した場合は、 [現在のモジュール]/sample2 というパーシャルが読み込まれる target: after # 条件に当てはまるパーツ(この場合、 loginSuccess のすべてのパーツ)の bottom にテンプレートが挿入される
comment:4 Changed 14 years ago by
view.yml のサンプルが間違っていました。
all: # すべてのページが対象 customize: sample1: template: member/sample1 # member/sample1 という指定で取得できるパーシャルを挿入する category: [diary] # diary カテゴリが設定されているパーツに対してのみ挿入する parts: [exampleParts] # exampleParts という ID を持つパーツに対してのみ挿入する target: [bottom] # 条件に当てはまるパーツの bottom に挿入する loginSuccess: # loginSuccess アクションが対象 customize: sample2: # template を省略した場合は、 [現在のモジュール]/sample2 というパーシャルが読み込まれる target: [after] # 条件に当てはまるパーツ(この場合、 loginSuccess のすべてのパーツ)の bottom にテンプレートが挿入される
Note: See
TracTickets for help on using
tickets.
http://sns.openpne.jp/?m=pc&a=page_c_topic_detail&target_c_commu_topic_id=4034 の 5番目のコメントの内容を転記します。