Error:"module" is disabled in this context

I try to use global module inside another module like this:

{% module path="/Global content/Global Groups/Oceania Theme 2016/Oceania Theme 2016/Blog Email Subscription" %}

And always get the following errors:

Error:“module” is disabled in this context

And

Error: Cannot resolve property “module”

I’ve searched a lot, but no luck.

Thanks in advance for your help.

Hi @ballonura, you can’t have modules within modules in HubL. If you want to include some sort of repeatable code in a module you could use macros instead.

there is way to convert from global module to macros?

No, you’ll have to create a new HTML + HubL file, then copy-paste your code and edit the HubL variables e.g. replace something like {{module.title}} with {{title}} and make sure all variables are passed as arguments to the macro

{% macro myMacro(title, btn_text, btn_url) -%}
<div class="foo">
 <h1>{{title}}</h1>
 <a href="{{btn_url}}">{{btn_text}}</a>
</div>
{%- endmacro %}

Then use the macro in a module like so with the module variables in the relevant positions in the arguments list.

{% from '[macro url]' import myMacro %}
{{ myMacro(module.title, module.btn_text, module.btn_url) }}