Accessing parameters in custom module

SOLVE
Olon
Member

Hello,

in the docs, it says we can add custom parameters to modules. However the way to access them from inside the module is not specified. Heres my code:

 

{% module "module_152889614697214" module_id="3085289" label='Test', myParam='hello' %}

I've tried module.myParam with no luck.

 

Thanks

0 Upvotes
1 Accepted solution

Accepted Solutions
tjoyce
Solution
Recognized Expert | Platinum Partner

The parameter cannot be arbitrary. You need to create the field in the custom module builder and then when you call it with the HUBL code in your template, that parameter name needs to match the parameter name inside the module.

 

Example:

In the dropdown in the custom module builder, you would choose text_field with a name of my_text_fied, now, you can pass a parameter that matches that name

{% module "module_152889614697214" module_id="3085289" label='Test', my_text_field='hello' %}

Then, inside of your module, all you have to do is 

{{module.my_text_field}}

tim@belch.io

View solution in original post

0 Upvotes
1 Reply 1
tjoyce
Solution
Recognized Expert | Platinum Partner

The parameter cannot be arbitrary. You need to create the field in the custom module builder and then when you call it with the HUBL code in your template, that parameter name needs to match the parameter name inside the module.

 

Example:

In the dropdown in the custom module builder, you would choose text_field with a name of my_text_fied, now, you can pass a parameter that matches that name

{% module "module_152889614697214" module_id="3085289" label='Test', my_text_field='hello' %}

Then, inside of your module, all you have to do is 

{{module.my_text_field}}

tim@belch.io

View solution in original post

0 Upvotes