<?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: Custom Module Hubl Code If Elif - Going in Circles in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197709#M6920</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/18852"&gt;@jflow&lt;/a&gt;&amp;nbsp;- I think a structure like this might work for you&lt;/P&gt;&lt;PRE&gt;{% if widget.optional_url %}

	{% set bgColorClass = 'mobiledarkbg' %}
	{% if module.mobilebgcolor.value == 'mobilelightbg' %}
		{% set bgColorClass = 'mobilelightbg' %}
	{% endif %}

	&amp;lt;div class="image-and-text {{bgColorClass}}"&amp;gt;

		{% if widget.text %}

		{% endif %}
		
	&amp;lt;/div&amp;gt;
{% endif %}&lt;/PRE&gt;&lt;P&gt;OR:&lt;/P&gt;&lt;PRE&gt;{% if widget.optional_url %}

	&amp;lt;div class="image-and-text {{module.mobilebgcolor.value}}"&amp;gt;

		{% if widget.text %}

		{% endif %}
		
	&amp;lt;/div&amp;gt;
{% endif %}&lt;/PRE&gt;&lt;HR /&gt;&lt;P&gt;If this answer helped, please, mark as solved &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;tim@belch.io | &lt;A href="https://forms.belch.io" target="_blank"&gt;forms.belch.io&lt;/A&gt; | Design your own Beautiful HubSpot Forms; No coding necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Drop by and say Hi to me &lt;A href="http://slack.belch.io/" target="_blank"&gt;on slack&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jul 2018 17:51:08 GMT</pubDate>
    <dc:creator>tjoyce</dc:creator>
    <dc:date>2018-07-16T17:51:08Z</dc:date>
    <item>
      <title>Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197698#M6918</link>
      <description>&lt;P&gt;Hi there-&lt;/P&gt;&lt;P&gt;Have a working custom module I created that is currently used on our site that allows folks to create a block that includes an Image, Heading Text and Rich Text Area with the class image-and-text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently there's an IF statement for the whole thing - shows Version 1 if there's a URL in the URL field and Version 2 with no &amp;lt;a wrapper if there is NO URL in the URL field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NEW OPTION NEEDED&amp;nbsp; &lt;/STRONG&gt;We'd like to be able to add a class so we can specify a background color used for that block when in mobile view.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a new field called Mobile BG Color - if it's set to None, I'd like the regular code to load.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;div class="image-and-text"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's set to Light Background, I'd like the code to load with&amp;nbsp;the additional class of&amp;nbsp;&lt;SPAN&gt;mobilelightbg&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;div class="image-and-text mobilelightbg"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If set to Dark Background&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;div class="image-and-text mobiledarkbg"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am getting lost in code and not sure I'm even stacking the if in an if correctly.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Not hopeful since&amp;nbsp;this attempt is a bit of a cluster now but if anyone chimes in, absolutely grateful!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ORIGINAL CODE&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{% if widget.optional_url %}

&amp;lt;div class="image-and-text"&amp;gt;
	&amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
    &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}"  
                     width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
 	&amp;lt;/a&amp;gt;
&amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
&amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
  &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;
&amp;lt;/a&amp;gt;
{% if widget.text %}
     {% inline_rich_text field="text" value="{{ module.text }}" %}
{% endif %}    
&amp;lt;/div&amp;gt; 
{% else %} 
&amp;lt;div class="image-and-text"&amp;gt;
    &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}" 
                     width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
&amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
  &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;  
{% if widget.text %}
     {% inline_rich_text field="text" value="{{ module.text }}" %}
{% endif %}    
&amp;lt;/div&amp;gt;    
{% endif %}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NEW CODE ATTEMPT&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{% if widget.optional_url %}

	{% if module.mobilebgcolor.value == 'mobilelightbg' %}

    &amp;lt;div class="image-and-text mobilelightbg"&amp;gt;
      &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
        &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}"  
                         width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
      &amp;lt;/a&amp;gt;
    &amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
    &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
      &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;
    &amp;lt;/a&amp;gt;
    {% if widget.text %}
         {% inline_rich_text field="text" value="{{ module.text }}" %}
    
	{% elif module.mobilebgcolor.value == 'mobiledarkbg' %}   

      {% else %}
            &amp;lt;div class="image-and-text mobiledarkbg"&amp;gt;
      &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
        &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}"  
                         width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
      &amp;lt;/a&amp;gt;
    &amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
    &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
      &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;
    &amp;lt;/a&amp;gt;
    {% if widget.text %}
         {% inline_rich_text field="text" value="{{ module.text }}" %}

        {% endif %}       
            
	{% endif %}      
    
{% endif %}    
&amp;lt;/div&amp;gt; 
{% else %} 
&amp;lt;div class="image-and-text"&amp;gt;
    &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}" 
                     width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
&amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
  &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;  
{% if widget.text %}
     {% inline_rich_text field="text" value="{{ module.text }}" %}
{% endif %}    
&amp;lt;/div&amp;gt;    
{% endif %}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 17:16:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197698#M6918</guid>
      <dc:creator>jflow</dc:creator>
      <dc:date>2018-07-16T17:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197709#M6920</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/18852"&gt;@jflow&lt;/a&gt;&amp;nbsp;- I think a structure like this might work for you&lt;/P&gt;&lt;PRE&gt;{% if widget.optional_url %}

	{% set bgColorClass = 'mobiledarkbg' %}
	{% if module.mobilebgcolor.value == 'mobilelightbg' %}
		{% set bgColorClass = 'mobilelightbg' %}
	{% endif %}

	&amp;lt;div class="image-and-text {{bgColorClass}}"&amp;gt;

		{% if widget.text %}

		{% endif %}
		
	&amp;lt;/div&amp;gt;
{% endif %}&lt;/PRE&gt;&lt;P&gt;OR:&lt;/P&gt;&lt;PRE&gt;{% if widget.optional_url %}

	&amp;lt;div class="image-and-text {{module.mobilebgcolor.value}}"&amp;gt;

		{% if widget.text %}

		{% endif %}
		
	&amp;lt;/div&amp;gt;
{% endif %}&lt;/PRE&gt;&lt;HR /&gt;&lt;P&gt;If this answer helped, please, mark as solved &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;tim@belch.io | &lt;A href="https://forms.belch.io" target="_blank"&gt;forms.belch.io&lt;/A&gt; | Design your own Beautiful HubSpot Forms; No coding necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Drop by and say Hi to me &lt;A href="http://slack.belch.io/" target="_blank"&gt;on slack&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 17:51:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197709#M6920</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-07-16T17:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197718#M6925</link>
      <description>&lt;P&gt;Hey thanks so much,&amp;nbsp;AM closer. Tried the 2nd version first, didn't insert extra class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then tried the first option but the inserted CSS class stays at mobiledarkbg,&amp;nbsp;it's not switching to mobilelightbg when you choose the Light BG option. Tried to tweak this code as is, couldn't get to switch, I know I'd need to edit the code to&amp;nbsp;have it add no additional class if they pick None but figured just try to get this part working.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 18:26:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197718#M6925</guid>
      <dc:creator>jflow</dc:creator>
      <dc:date>2018-07-16T18:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197720#M6926</link>
      <description>&lt;P&gt;Do you want to paste what you have so far, so we can take a look?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 18:32:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197720#M6926</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-07-16T18:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197725#M6927</link>
      <description>&lt;P&gt;Thanks, here's where we are now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{% if widget.optional_url %}

	{% set bgColorClass = 'mobiledarkbg' %}
	{% if module.mobilebgcolor.value == 'mobilelightbg' %}
		{% set bgColorClass = 'mobilelightbg' %}
	{% endif %}

      &amp;lt;div class="image-and-text  {{bgColorClass}}"&amp;gt;
        &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
          &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}"  
                           width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
        &amp;lt;/a&amp;gt;
      &amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
      &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
        &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;
      &amp;lt;/a&amp;gt;
      {% if widget.text %}
           {% inline_rich_text field="text" value="{{ module.text }}" %}
      {% endif %}    
      &amp;lt;/div&amp;gt; 
{% else %} 
          
	{% set bgColorClass = 'mobiledarkbg' %}
	{% if module.mobilebgcolor.value == 'mobilelightbg' %}
		{% set bgColorClass = 'mobilelightbg' %}
	{% endif %}          
          
    &amp;lt;div class="image-and-text  {{bgColorClass}}"&amp;gt;
        &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}" 
                         width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
    &amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
      &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;  
    {% if widget.text %}
         {% inline_rich_text field="text" value="{{ module.text }}" %}
    {% endif %}    
    &amp;lt;/div&amp;gt;    
{% endif %}&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Jul 2018 18:39:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197725#M6927</guid>
      <dc:creator>jflow</dc:creator>
      <dc:date>2018-07-16T18:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197728#M6929</link>
      <description>&lt;P&gt;Can you just print&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{{module.mobilebgcolor.value}}&lt;/PRE&gt;&lt;P&gt;to the screen and change the dropdown, just to be sure the value is changing and we know the exact classes to check against the if statement?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 18:44:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197728#M6929</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-07-16T18:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197730#M6930</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hey almost there, thanks!&amp;nbsp;In this section: the {{ module.mobilebgcolor }} does display on the Preview screen but the {{module-mobilebgcolor.value}} did not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;      &amp;lt;div&amp;gt;MOBILE COLOR &amp;amp;nbsp;  {{ module.mobilebgcolor }}&amp;lt;/div&amp;gt;
        {{module.mobilebgcolor.value}}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So&amp;nbsp;tweaked to remove .value and now the class IS showing and it's switching between dark and light&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FULL CODE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{% if widget.optional_url %}

	{% set bgColorClass = 'mobiledarkbg' %}
	{% if module.mobilebgcolor == 'mobilelightbg' %}
		{% set bgColorClass = 'mobilelightbg' %}
	{% endif %}

      &amp;lt;div class="image-and-text  {{bgColorClass}}"&amp;gt;
        &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
          &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}"  
                           width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
        &amp;lt;/a&amp;gt;
      &amp;lt;div&amp;gt;MOBILE COLOR &amp;amp;nbsp;  {{ module.mobilebgcolor }}&amp;lt;/div&amp;gt;
        {{module.mobilebgcolor.value}}
      &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
        &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;
      &amp;lt;/a&amp;gt;
      {% if widget.text %}
           {% inline_rich_text field="text" value="{{ module.text }}" %}
      {% endif %}    
      &amp;lt;/div&amp;gt; 
{% else %} 
          
	{% set bgColorClass = 'mobiledarkbg' %}
	{% if module.mobilebgcolor == 'mobilelightbg' %}
		{% set bgColorClass = 'mobilelightbg' %}
	{% endif %}          
          
    &amp;lt;div class="image-and-text  {{bgColorClass}}"&amp;gt;
        &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}" 
                         width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
      &amp;lt;div&amp;gt;MOBILE COLOR &amp;amp;nbsp;  {{ module.mobilebgcolor }}&amp;lt;/div&amp;gt;
          {{module.mobilebgcolor.value}}
      &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;  
    {% if widget.text %}
         {% inline_rich_text field="text" value="{{ module.text }}" %}
    {% endif %}    
    &amp;lt;/div&amp;gt;    
{% endif %}&lt;/PRE&gt;&lt;P&gt;Going to play and see if I can figure out the "None" option now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 19:05:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197730#M6930</guid>
      <dc:creator>jflow</dc:creator>
      <dc:date>2018-07-16T19:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197731#M6931</link>
      <description>&lt;P&gt;Glad it's working.&lt;/P&gt;&lt;P&gt;one more thing you should do to clean up the code is remove the wrapping if statement. There is too much duplicate code; condense it like this:&lt;/P&gt;&lt;PRE&gt;	{% set bgColorClass = 'mobiledarkbg' %}
	{% if module.mobilebgcolor.value == 'mobilelightbg' %}
		{% set bgColorClass = 'mobilelightbg' %}
	{% endif %}

      &amp;lt;div class="image-and-text  {{bgColorClass}}"&amp;gt;
        &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
          &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}"  
                           width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
        &amp;lt;/a&amp;gt;
      &amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
      {% if widget.optional_url %}
        &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
          &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;
        &amp;lt;/a&amp;gt;
      {% else %}
            &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}" 
                         width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
        {% endif %}          
      {% if widget.text %}
           {% inline_rich_text field="text" value="{{ module.text }}" %}
      {% endif %}    
      &amp;lt;/div&amp;gt; &lt;/PRE&gt;&lt;HR /&gt;&lt;P&gt;If this answer helped, please, mark as solved &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;tim@belch.io | &lt;A href="https://forms.belch.io" target="_blank"&gt;forms.belch.io&lt;/A&gt; | Design your own Beautiful HubSpot Forms; No coding necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Drop by and say Hi to me &lt;A href="http://slack.belch.io/" target="_blank"&gt;on slack&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 19:09:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197731#M6931</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-07-16T19:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197735#M6932</link>
      <description>&lt;P&gt;Thanks so much - that was the last part of my 'overthinking' to clean up. Dropped in with the "none" option and working like a champ. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ONE LAST QUESTIONS IF YOU'RE STILL AVAILABLE:&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;I created a color picker for my Heading Text field, works just fine.&amp;nbsp; Do you know if it's possible to do the same on the rich text field? Had no luck there.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 19:20:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197735#M6932</guid>
      <dc:creator>jflow</dc:creator>
      <dc:date>2018-07-16T19:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197736#M6933</link>
      <description>&lt;P&gt;Awesome!&lt;/P&gt;&lt;P&gt;Yea, you can wrap the richtext in a div and as long as there aren't any overrides from the user, in the wysiwyg on text color, it should inherit the parent div color.&lt;/P&gt;&lt;P&gt;Something like:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;div style="color: {{widget_data.somecolorpicker.color}}"&amp;gt;
  //insert your richetext module here
&amp;lt;/div&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Jul 2018 19:23:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197736#M6933</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-07-16T19:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197741#M6934</link>
      <description>&lt;P&gt;Yeah not sure what I was doing wrong there, looks similar but I was off somehow.&lt;/P&gt;&lt;P&gt;All settled, color pickers galore - woo. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 19:39:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197741#M6934</guid>
      <dc:creator>jflow</dc:creator>
      <dc:date>2018-07-16T19:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Module Hubl Code If Elif - Going in Circles</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197744#M6935</link>
      <description>&lt;P&gt;&lt;STRONG&gt;FINAL CODE: &lt;/STRONG&gt;(previous code was causing duplicate image at top)&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;PRE&gt;	{% set bgColorClass = '' %}
	{% if module.mobilebgcolor == 'mobilelightbg' %}
		{% set bgColorClass = 'mobilelightbg' %}
	{% elif module.mobilebgcolor == 'mobiledarkbg' %}
		{% set bgColorClass = 'mobiledarkbg' %}
	{% elif module.mobilebgcolor == 'none' %}
		{% set bgColorClass = '' %}
	{% endif %}

      &amp;lt;div class="image-and-text {{bgColorClass}}"&amp;gt;
      &amp;lt;div&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
      {% if widget.optional_url %}
        &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
          &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}"  
                           width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
        &amp;lt;/a&amp;gt;        
        &amp;lt;a href="{% inline_text field="optional_url" value="{{ module.optional_url }}", no_wrapper=True %}"&amp;gt;
          &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;
        &amp;lt;/a&amp;gt;
      {% else %}
            &amp;lt;img alt="{% inline_text field="image_alt_text" value="{{ module.image_alt_text }}", no_wrapper=True %}" src="{{ module.image_src_url }}" 
                         width="{{ module.width }}" height="auto" style="display: block; margin: 0px auto;"/&amp;gt;
          &amp;lt;{{ module.heading_type }} style="color: {{ module.header_text_color }}; text-align: center; font-weight: {{ module.header_font_weight }};"&amp;gt;{% inline_text field="heading_text_under_image" value="{{ module.heading_text_under_image }}" %}&amp;lt;/{{ module.heading_type }}&amp;gt;           
        {% endif %}          
      {% if widget.text %}
				&amp;lt;div style="color: {{ module.rich_text_color }}"&amp;gt;
					{% inline_rich_text field="text" value="{{ module.text }}" %}
        &amp;lt;/div&amp;gt;
      {% endif %}    
      &amp;lt;/div&amp;gt; 
            &lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Jul 2018 20:19:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Custom-Module-Hubl-Code-If-Elif-Going-in-Circles/m-p/197744#M6935</guid>
      <dc:creator>jflow</dc:creator>
      <dc:date>2018-07-16T20:19:41Z</dc:date>
    </item>
  </channel>
</rss>

