<?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: Calling a module from within a module in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/725246#M31674</link>
    <description>&lt;P&gt;hmm then it would be sound dumb to use hubspot than just react huh&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2022 10:39:47 GMT</pubDate>
    <dc:creator>fdido</dc:creator>
    <dc:date>2022-12-01T10:39:47Z</dc:date>
    <item>
      <title>Calling a module from within a module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/332664#M16200</link>
      <description>&lt;P&gt;Hi Forum, my apologies if this is already covered, please point me to the resource in that case!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if it's possible to "nest" code modules, i.e. calling in the entire functionality from a module in another module.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case I have a 2-column layout thing with left and right containers, which can hold rich text, image, video embed or a blog list. The content editor selects the type of content from a switch in the module.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So Hubspot has this ready-made video-embed module that pulls in Youtube or Vimeo clips. Can I somehow reference that whole module from my module and get it to work? Or do I need to copy the entire video module code into my module? Seems like bad practice to duplicate code like this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping for something as simple as in the below, like "if 'video' is selected, enable this video module".&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just a designer and self-taught coder.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;div class="page-center content-section"&amp;gt;
  &amp;lt;div class="two-column-highlight"&amp;gt;
    
    &amp;lt;!-- RICH TEXT BOX --&amp;gt;
    &amp;lt;div class="highlight text {% if module.image_position =='img_left' %}image-left{% endif %}"&amp;gt;
      {% inline_rich_text field="highlight_text" value="{{ module.highlight_text }}" %}
    &amp;lt;/div&amp;gt;
    
    &amp;lt;!-- OPTION: IMAGE --&amp;gt;
    {% if module.media_content == 'image' %}
    &amp;lt;div class="highlight {% if module.image_position =='img_left' %}image-left{% endif %}"&amp;gt;
        &amp;lt;img src="{{ module.image.src }}" alt="{{ module.image.alt }}" {{ sizeAttrs }}&amp;gt;
    &amp;lt;/div&amp;gt;
    
    &amp;lt;!-- OPTION: VIDEO --&amp;gt;
    {% elif module.media_content == 'video' %}
    &amp;lt;div class="highlight {% if module.image_position =='img_left' %}image-left{% endif %}"&amp;gt;
     &lt;FONT color="#FF9900"&gt; {% module "module_1587375821196241" path="@hubspot/video_embed_lp", label="Video Embed - LP" %}&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Apr 2020 11:28:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/332664#M16200</guid>
      <dc:creator>Oloph</dc:creator>
      <dc:date>2020-04-20T11:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a module from within a module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/332673#M16201</link>
      <description>&lt;P&gt;Hi Oloph,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In both the design manager and local dev with the CLI, you will get an error showing that "'module' is disabled in this context" - so unfortunately I don't think that this is possible to do and you would need to add the code directly to your module.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 12:08:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/332673#M16201</guid>
      <dc:creator>BenSBM</dc:creator>
      <dc:date>2020-04-20T12:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a module from within a module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/332803#M16211</link>
      <description>&lt;P&gt;Many thanks for replying Ben. So we're not quite there where we can build portable minimodules for re-use in other modules.&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK, will research workarounds. And learn!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 19:22:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/332803#M16211</guid>
      <dc:creator>Oloph</dc:creator>
      <dc:date>2020-04-20T19:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a module from within a module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/725246#M31674</link>
      <description>&lt;P&gt;hmm then it would be sound dumb to use hubspot than just react huh&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 10:39:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/725246#M31674</guid>
      <dc:creator>fdido</dc:creator>
      <dc:date>2022-12-01T10:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a module from within a module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/1011356#M39897</link>
      <description>&lt;P&gt;&lt;A href="https://community.hubspot.com/t5/CMS-Development/Module-within-a-Module/td-p/768057" target="_blank" rel="noopener"&gt;Adding this more recent thread as a referernce.&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 14:46:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/1011356#M39897</guid>
      <dc:creator>CXurious</dc:creator>
      <dc:date>2024-07-17T14:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a module from within a module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/1095647#M41800</link>
      <description>&lt;P&gt;Hi, Can we implement a module within a module?&lt;BR /&gt;I have to repeat my code?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 00:57:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/1095647#M41800</guid>
      <dc:creator>JRodriguez76</dc:creator>
      <dc:date>2025-01-17T00:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a module from within a module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/1129007#M42557</link>
      <description>&lt;P&gt;The way Hubspot solves for this is interesting. This is where Macros come in. You can create your "atoms" as macros then call them in other components to achieve what, in some CMSs are known as "complex components"--or combining multiple components to achieve a single experience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no way to call a module within a module in hubspot. So you have to create the element you want to repurpose as a macro.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Just remember that your component field JSON has to match to get a consistent authoring/display experience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm pretty sure it was &lt;A href="https://www.youtube.com/watch?v=GRXDz9nY5yM&amp;amp;list=PLTGNq2fWP3b38i_YC6LNiEgrt7pMLqt2w&amp;amp;index=13" target="_blank" rel="noopener"&gt;this dhug video&lt;/A&gt; that helped me understand the macro as the solution to the complex component.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2025 16:08:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Calling-a-module-from-within-a-module/m-p/1129007#M42557</guid>
      <dc:creator>CXurious</dc:creator>
      <dc:date>2025-03-28T16:08:08Z</dc:date>
    </item>
  </channel>
</rss>

