<?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: How to return values for Alignment Field on Styles tab - alignment_field in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/944310#M38355</link>
    <description>&lt;P&gt;I found that for the &lt;A href="https://developers.hubspot.com/docs/cms/building-blocks/module-theme-fields#text-alignment" target="_blank" rel="noopener"&gt;Text Alignment field&lt;/A&gt;, that the documentation is a bit sparse on what needs to go into your Hubl code. It was not obvious to me at first but I found this worked:&lt;/P&gt;
&lt;P&gt;.product-filter h2 { &lt;BR /&gt;&amp;nbsp; color: {{ module.style.heading_color.color }};&lt;BR /&gt;&amp;nbsp; text-align: {{ module.style.heading_alignment.text_align }};&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;This returns:&lt;/P&gt;
&lt;P&gt;#hs_cos_wrapper_widget_1707440351533 .product-filter h2 {&lt;BR /&gt;&amp;nbsp; color: #FFFFFF;&lt;BR /&gt;&amp;nbsp; text-align: CENTER;&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2024 09:46:29 GMT</pubDate>
    <dc:creator>JohnLaprairie</dc:creator>
    <dc:date>2024-03-15T09:46:29Z</dc:date>
    <item>
      <title>How to return values for Alignment Field on Styles tab - alignment_field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/820219#M35033</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I have added the &lt;A href="https://developers.hubspot.com/docs/cms/building-blocks/module-theme-fields#alignment" target="_blank" rel="noopener"&gt;Alignment Field&lt;/A&gt; to my custom module. I cannot find any way to actually return the value of the user's selection, nor is there any documentation on that.&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;If anyone has a cheat sheet for all the module theme fields, that would be especially great.&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;For example, for the color module, you can return it like&lt;/P&gt;
&lt;PRE data-unlink="true"&gt;module.field_group.field_name.color&lt;BR /&gt;module.field_group.field_name.opacity&lt;/PRE&gt;
&lt;P data-unlink="true"&gt;For images, you can return it like&lt;/P&gt;
&lt;PRE data-unlink="true"&gt;module.field_group.field_name.css&lt;/PRE&gt;
&lt;P data-unlink="true"&gt;It seems to not follow any standard pattern and there is nothing indicating how to output it on Hubspot's official documentation.&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Here are some things I've tried with my alignment module, but each time it returns empty&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE data-unlink="true"&gt;{{ module.bg_style.alignment_field }} {# the snippet #}&lt;BR /&gt;{{ module.bg_style.alignment_field.css }}&lt;BR /&gt;{{ module.bg_style.alignment_field.horizontal_align }}&lt;BR /&gt;{{ module.bg_style.alignment_field.horizontal_align.css }}&lt;/PRE&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I appreciate any help!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 20:07:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/820219#M35033</guid>
      <dc:creator>marenhogan</dc:creator>
      <dc:date>2023-07-14T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to return values for Alignment Field on Styles tab - alignment_field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/820244#M35035</link>
      <description>&lt;P&gt;Try this one for Horizontal and vertical separately and don't forget the change the alignment field to verify the working of it.&lt;/P&gt;&lt;P&gt;{{ module.bg_style.alignment_field.horizontal_align }}&lt;/P&gt;&lt;P&gt;{{ module.bg_style.alignment_field.vertical_align }}&lt;/P&gt;&lt;P&gt;If anything else please let me know.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 21:20:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/820244#M35035</guid>
      <dc:creator>Chetan_1</dc:creator>
      <dc:date>2023-07-14T21:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to return values for Alignment Field on Styles tab - alignment_field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/820805#M35047</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/46249"&gt;@marenhogan&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This kind of custom field, you can you following syntax&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;1) Color field&lt;BR /&gt;{&lt;/STRONG&gt;&lt;BR /&gt;  color: rgba({{module.field_group.field_name.color|convert_rgb}},{{module.field_group.field_name.opacity / 100 }});&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;2) Alignment field&lt;BR /&gt;&lt;/STRONG&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text-align: {{ module.bg_style.alignment_field.horizontal_align }};&lt;BR /&gt;}&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;Link: &lt;A href="https://developers.hubspot.com/docs/cms/building-blocks/module-theme-fields" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/cms/building-blocks/module-theme-fields&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The above syntax it can help you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:18:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/820805#M35047</guid>
      <dc:creator>ankitparmar09</dc:creator>
      <dc:date>2023-07-17T13:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to return values for Alignment Field on Styles tab - alignment_field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/821568#M35062</link>
      <description>&lt;P&gt;Thanks! Adding the text-align did the trick. I wish there was some indication in the documentation as to what exactly it returns. For some items, you use .color, or .css and for some you do not.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 17:20:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/821568#M35062</guid>
      <dc:creator>marenhogan</dc:creator>
      <dc:date>2023-07-18T17:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to return values for Alignment Field on Styles tab - alignment_field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/821569#M35063</link>
      <description>&lt;P&gt;Thanks! It looks like it only returns left, right, etc so I needed to add the text-align piece (above) as well. Appreciate it!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 17:21:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/821569#M35063</guid>
      <dc:creator>marenhogan</dc:creator>
      <dc:date>2023-07-18T17:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to return values for Alignment Field on Styles tab - alignment_field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/881357#M36784</link>
      <description>&lt;P&gt;Thanks for this. The developer documentation is missing the output structure for style fields, especially considering the syntax is inconsistent.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 18:48:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/881357#M36784</guid>
      <dc:creator>JHuffman1</dc:creator>
      <dc:date>2023-11-17T18:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to return values for Alignment Field on Styles tab - alignment_field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/944310#M38355</link>
      <description>&lt;P&gt;I found that for the &lt;A href="https://developers.hubspot.com/docs/cms/building-blocks/module-theme-fields#text-alignment" target="_blank" rel="noopener"&gt;Text Alignment field&lt;/A&gt;, that the documentation is a bit sparse on what needs to go into your Hubl code. It was not obvious to me at first but I found this worked:&lt;/P&gt;
&lt;P&gt;.product-filter h2 { &lt;BR /&gt;&amp;nbsp; color: {{ module.style.heading_color.color }};&lt;BR /&gt;&amp;nbsp; text-align: {{ module.style.heading_alignment.text_align }};&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;This returns:&lt;/P&gt;
&lt;P&gt;#hs_cos_wrapper_widget_1707440351533 .product-filter h2 {&lt;BR /&gt;&amp;nbsp; color: #FFFFFF;&lt;BR /&gt;&amp;nbsp; text-align: CENTER;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 09:46:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/944310#M38355</guid>
      <dc:creator>JohnLaprairie</dc:creator>
      <dc:date>2024-03-15T09:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to return values for Alignment Field on Styles tab - alignment_field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/946545#M38412</link>
      <description>&lt;P&gt;HubSpot documentation is overall GREAT. But it&amp;nbsp;&lt;EM&gt;is&lt;/EM&gt; missing some key details on what snippets should be for style fields in the module editor.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 08:09:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-return-values-for-Alignment-Field-on-Styles-tab-alignment/m-p/946545#M38412</guid>
      <dc:creator>JHuffman1</dc:creator>
      <dc:date>2024-03-20T08:09:37Z</dc:date>
    </item>
  </channel>
</rss>

