2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

モジュール名は自由に命名可能

Last updated at Posted at 2021-06-17

モジュール名は自由に命名可能

自動生成されるデフォルトのモジュール名:
下記の例では:module_16237379939912

{% module "module_16237379939912" path="/new-boilerplate/modules/breadcrumb", label="breadcrumb" %}

テンプレート上で利用する場合は自由にモジュール名をつけてモジュール内のデータを利用可能。パスで紐付いているので名前は自由につけて良い。

{% module "my_breadcrumb" path="/new-boilerplate/modules/breadcrumb", label="breadcrumb" %}

モジュール内のデータを利用するためには下記記述が必要


// 追加:export_to_template_context=True
{% module "my_breadcrumb" path="/new-boilerplate/modules/breadcrumb", label="breadcrumb", export_to_template_context=True %}


// モジュール内のdirnameの入力データを利用したい場合
{{ widget_data.my_breadcrumb.body.dirname }} 

旧仕様なのか下記でも利用可能
{{ content.widgets.my_breadcrumb.body.dirname }} 

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?