CMS Development

vin-aws
Contributor

Accessing module value that is defined inside custom module

SOLVE

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 Upvotes
1 Accepted solution
TRooInbound
Solution
Key Advisor

Accessing module value that is defined inside custom module

SOLVE

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

 

View solution in original post

1 Reply 1
TRooInbound
Solution
Key Advisor

Accessing module value that is defined inside custom module

SOLVE

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