CMS Development

vin-aws
投稿者

Accessing module value that is defined inside custom module

解決

Say I have:

 

{% for i in range(3) %}
    {% text label="Video Embed" "video_embed" no_wrapper=True, unique_in_loop=True, value="" %}

How would I access the value of this text module? I know if it is created in the custom module sidebar itself I can simply do {{ widget.my_text }} but this is created on the template page only.

0 いいね!
1件の承認済みベストアンサー
TRooInbound
解決策
キーアドバイザー

Accessing module value that is defined inside custom module

解決

Hi @vin-aws,

 

You can get value of textbox using below syntax code

{{ content.widgets.module_name.body.value }}

For your block of code you have added video_embed name to your text module, so you need to replace module_name with your module name like below

{{ content.widgets.video_embed.body.value }}

Hope it works for you

 

Did our post help answer your query? Help the Community by marking it as a solution.

 

Team TRooInbound | hello@trooinbound.com | https://www.trooinbound.com

 

元の投稿で解決策を見る

1件の返信
TRooInbound
解決策
キーアドバイザー

Accessing module value that is defined inside custom module

解決

Hi @vin-aws,

 

You can get value of textbox using below syntax code

{{ content.widgets.module_name.body.value }}

For your block of code you have added video_embed name to your text module, so you need to replace module_name with your module name like below

{{ content.widgets.video_embed.body.value }}

Hope it works for you

 

Did our post help answer your query? Help the Community by marking it as a solution.

 

Team TRooInbound | hello@trooinbound.com | https://www.trooinbound.com