<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error:&amp;quot;module&amp;quot; is disabled in this context in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Error-quot-module-quot-is-disabled-in-this-context/m-p/390474#M19868</link>
    <description>&lt;P&gt;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&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% macro myMacro(title, btn_text, btn_url) -%}
&amp;lt;div class="foo"&amp;gt;
  &amp;lt;h1&amp;gt;{{title}}&amp;lt;/h1&amp;gt;
  &amp;lt;a href="{{btn_url}}"&amp;gt;{{btn_text}}&amp;lt;/a&amp;gt;
&amp;lt;/div&amp;gt;
{%- endmacro %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use the macro in a module like so with the module variables in the relevant positions in the arguments list.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% from '[macro url]' import myMacro %}
{{ myMacro(module.title, module.btn_text, module.btn_url) }}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Dec 2020 08:44:39 GMT</pubDate>
    <dc:creator>piersg</dc:creator>
    <dc:date>2020-12-02T08:44:39Z</dc:date>
    <item>
      <title>Error:"module" is disabled in this context</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Error-quot-module-quot-is-disabled-in-this-context/m-p/390227#M19851</link>
      <description>&lt;P&gt;I try to use global module inside another module like this:&lt;/P&gt;&lt;PRE&gt;{% module path="/Global content/Global Groups/Oceania Theme 2016/Oceania Theme 2016/Blog Email Subscription" %}&lt;/PRE&gt;&lt;P&gt;And always get the following errors:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error:"module" is disabled in this context&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;And&lt;/P&gt;&lt;DIV class="media private-media error-message"&gt;&lt;DIV class="media-body private-media__body"&gt;&lt;STRONG&gt;&lt;SPAN class="p-right-2"&gt;Error:&amp;nbsp;&lt;/SPAN&gt;Cannot resolve property "module"&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="media private-media error-message"&gt;&lt;DIV class="private-media__item private-media__item--left"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I've searched a lot, but no luck.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 13:33:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Error-quot-module-quot-is-disabled-in-this-context/m-p/390227#M19851</guid>
      <dc:creator>ballonura</dc:creator>
      <dc:date>2020-12-01T13:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error:"module" is disabled in this context</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Error-quot-module-quot-is-disabled-in-this-context/m-p/390329#M19855</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/121463"&gt;@ballonura&lt;/a&gt;,&amp;nbsp;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 &lt;A href="https://developers.hubspot.com/docs/cms/hubl/variables-macros-syntax#macros" target="_blank" rel="noopener"&gt;macros&lt;/A&gt; instead.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 17:29:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Error-quot-module-quot-is-disabled-in-this-context/m-p/390329#M19855</guid>
      <dc:creator>piersg</dc:creator>
      <dc:date>2020-12-01T17:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error:"module" is disabled in this context</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Error-quot-module-quot-is-disabled-in-this-context/m-p/390359#M19859</link>
      <description>&lt;P&gt;there is way to convert from&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;global module&lt;/EM&gt; to &lt;EM&gt;macros&lt;/EM&gt;?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 21:05:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Error-quot-module-quot-is-disabled-in-this-context/m-p/390359#M19859</guid>
      <dc:creator>ballonura</dc:creator>
      <dc:date>2020-12-01T21:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error:"module" is disabled in this context</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Error-quot-module-quot-is-disabled-in-this-context/m-p/390474#M19868</link>
      <description>&lt;P&gt;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&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% macro myMacro(title, btn_text, btn_url) -%}
&amp;lt;div class="foo"&amp;gt;
  &amp;lt;h1&amp;gt;{{title}}&amp;lt;/h1&amp;gt;
  &amp;lt;a href="{{btn_url}}"&amp;gt;{{btn_text}}&amp;lt;/a&amp;gt;
&amp;lt;/div&amp;gt;
{%- endmacro %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use the macro in a module like so with the module variables in the relevant positions in the arguments list.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% from '[macro url]' import myMacro %}
{{ myMacro(module.title, module.btn_text, module.btn_url) }}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 08:44:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Error-quot-module-quot-is-disabled-in-this-context/m-p/390474#M19868</guid>
      <dc:creator>piersg</dc:creator>
      <dc:date>2020-12-02T08:44:39Z</dc:date>
    </item>
  </channel>
</rss>

