Question about removing or hiding module from email template

SOLVE
Highlighted
Regular Contributor

Not a dev here:

I want to remove a module from an email template, to create a variant of an existing template. All else the same, CSS, the same, etc.

I cloned the original template, open the Cloned template in editor. I click to remove a module, and I get the warning: 
""This module has associated content

Content added to modules through the content editor will be removed from pages."

I'm worried if I delete this module from my cloned template, that it might disrupt/remove content that the module is leveraging in other templates, other email campaigns.
If I choose to delete/remove this module group from my cloned template, will it not affect teh same module being used in other instances? And if so, then how do I remove it from my cloned template. Don't want to use it it, see it.

Alternatively, is there a way in the inline styling text box to hide the module, in a way that works for all email clients? 
How should I proceed?





Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
Regular Contributor

Have you created an email using your new cloned template? If not, you should be fine. If you have, the warning screen should list any dependents that could be effected.

 

If everything in the template is the same and you just want the ability to hide a section if it is not being used in an email campaign, you could use a boolean condition to hide it.

 

Below is an example showing how an email section will show by default unless a checkbox is checked to hide it. If checked the table row won't be written in the code. This example is for coded templates only vs the new drag and drop email.

  <!-- start hide boolean hide condition -->
  {% boolean "hide_tips" label='Hide Tips', value=True, export_to_template_context=True %}
  {% if not widget_data.hide_tips.body.value %}
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="templateColumnWrapper">
    <tr>
      <td valign="middle" bgcolor="#ffc945" width="30%" class=" img-fluid column"   style=" text-align: center; padding: 0; font-family: {{ primary_font }}; font-size: 22px; line-height: {{ primary_font_lheight }}em; color: #ffffff;width:30%; ">
        {% widget_block rich_text "tips_tricks" overrideable=True, label='Tips Tricks'  %}
          {% widget_attribute "html" %}
        Tips &amp; Tricks  
          {% end_widget_attribute %}
        {% end_widget_block %}
      </td>
      <td valign="top"   width="70%" class=" column" style="width:70%; text-align: left; padding: 0; font-family: {{ primary_font }}; font-size: {{ primary_font_size }}; line-height: {{ primary_font_lheight }}em; color: {{ primary_font_color }}; ">
        <table cellspacing="0" cellpadding="" width="100%" class="text-padding">
          <tr>
            <td valign="top">
              {% widget_block rich_text "article_text_2" overrideable=True, label='Article Text 2'  %}
                {% widget_attribute "html" %}
                <h2><a href="#">Tips and Tricks</a></h2>
                <p>Around 30 words of text sit amet, consectetur adipisicing elit. Laudantium veniam libero adipisci placeat velit ab harum magnam. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium veniam libero. dolor sit amet, consectetur adipisicing elit. Laudantium veniam libero adipisci placeat velit ab harum magnam.</p>
                {% end_widget_attribute %}
              {% end_widget_block %}
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  {% endif %} <!--/ End boolean hide condition -->

Jacob Lett

Freelance HubSpot CMS Developer & Web Designer


bootstrapcreative-horizontal-trim.png

Located in Michigan, USA

Get a free estimate now


1 Reply 1
Highlighted
Regular Contributor

Have you created an email using your new cloned template? If not, you should be fine. If you have, the warning screen should list any dependents that could be effected.

 

If everything in the template is the same and you just want the ability to hide a section if it is not being used in an email campaign, you could use a boolean condition to hide it.

 

Below is an example showing how an email section will show by default unless a checkbox is checked to hide it. If checked the table row won't be written in the code. This example is for coded templates only vs the new drag and drop email.

  <!-- start hide boolean hide condition -->
  {% boolean "hide_tips" label='Hide Tips', value=True, export_to_template_context=True %}
  {% if not widget_data.hide_tips.body.value %}
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="templateColumnWrapper">
    <tr>
      <td valign="middle" bgcolor="#ffc945" width="30%" class=" img-fluid column"   style=" text-align: center; padding: 0; font-family: {{ primary_font }}; font-size: 22px; line-height: {{ primary_font_lheight }}em; color: #ffffff;width:30%; ">
        {% widget_block rich_text "tips_tricks" overrideable=True, label='Tips Tricks'  %}
          {% widget_attribute "html" %}
        Tips &amp; Tricks  
          {% end_widget_attribute %}
        {% end_widget_block %}
      </td>
      <td valign="top"   width="70%" class=" column" style="width:70%; text-align: left; padding: 0; font-family: {{ primary_font }}; font-size: {{ primary_font_size }}; line-height: {{ primary_font_lheight }}em; color: {{ primary_font_color }}; ">
        <table cellspacing="0" cellpadding="" width="100%" class="text-padding">
          <tr>
            <td valign="top">
              {% widget_block rich_text "article_text_2" overrideable=True, label='Article Text 2'  %}
                {% widget_attribute "html" %}
                <h2><a href="#">Tips and Tricks</a></h2>
                <p>Around 30 words of text sit amet, consectetur adipisicing elit. Laudantium veniam libero adipisci placeat velit ab harum magnam. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium veniam libero. dolor sit amet, consectetur adipisicing elit. Laudantium veniam libero adipisci placeat velit ab harum magnam.</p>
                {% end_widget_attribute %}
              {% end_widget_block %}
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  {% endif %} <!--/ End boolean hide condition -->

Jacob Lett

Freelance HubSpot CMS Developer & Web Designer


bootstrapcreative-horizontal-trim.png

Located in Michigan, USA

Get a free estimate now